(define (rl) (load "goo.ss")) (define regular-cons (lambda (h t) (cons h t))) (define curry-cons (lambda (h) (lambda (t) (cons h t)))) (define list-cons (lambda l (cons (car l) (cdr l)))) (define variable-num-args (lambda (x y . z) z)) (define mystery (lambda 'x 'x)) (define mystery2 (lambda (if x) (if x))) (define pythagoras (lambda (x y) (let ([x-squared (* x x)] [y-squared (* y y)]) (let ([hypotenuse (sqrt (+ x-squared y-squared))]) hypotenuse)))) ;(define pythagoras ; (lambda (x y) ; (let ([x-squared (* x x)] ; [y-squared (* y y)] ; [hypotenuse (sqrt (+ x-squared y-squared))]) ; hypotenuse)))) ;(define pythagoras ; (lambda (x y) ; ((lambda (x-squared y-squared hypothenuse) ; hypothenuse) ; (* x x) ; (* y y) ; (sqrt (+ x-squared y-squared))))) (define pythagoras (lambda (x y) (let* ([x-squared (* x x)] [y-squared (* y y)] [hypotenuse (sqrt (+ x-squared y-squared))]) hypotenuse))) (define pythagoras (lambda (x y) (let ([x-squared (* x x)]) (let ([y-squared (* y y)]) (let ([hypotenuse (sqrt (+ x-squared y-squared))]) hypotenuse))))) (define pythagorasLambda (lambda (x y) ((lambda (x-squared) ((lambda (y-squared) ((lambda (hypothenuse) hypothenuse) (sqrt (+ x-squared y-squared)))) (* y y))) (* x x)))) (define fac (lambda (n) (let ([fact (lambda (n) (if (= n 0) 1 (* n (fact (- n 1)))))]) (fact n)))) (define fac (lambda (n) ((lambda (fact) (fact n)) (lambda (n) (if (= n 0) 1 (* n (fact (- n 1)))))))) (define fac (lambda (n) (letrec ([fact (lambda (n) (if (= n 0) 1 (* n (fact (- n 1)))))]) (fact n))))