Lisp quotes
If you give someone Fortran, he has Fortran. If you give someone Lisp, he has any language he pleases.
- Guy L. Steele
[Lisp] is the only computer language that is beautiful.
- Neal Stephenson
Michael Matuzak // Programmer by day, booze drinking calamari cruncher by night.
If you give someone Fortran, he has Fortran. If you give someone Lisp, he has any language he pleases.
- Guy L. Steele
[Lisp] is the only computer language that is beautiful.
- Neal Stephenson
Learning about Pascals triangle for the next SICP exercise.
Wikipedia Page
Recursive:
(define (rf n)
(if (< n 3)
n
(+ (rf (- n 1))
(* 2 (rf (- n 2)))
(* 3 (rf (- n 3))))))
Iterative:
(define (f n)
(if (< n 3)
n
(f-iter 0 1 2 n)))
(define (f-iter a b c counter)
(if (= 0 counter)
a
(f-iter b c (+ c (* 2 b) (* 3 a)) (- counter 1))))
The iterative one took me a while to figure out. Every time I started I kept reverting back to recursive thinking.