The birth of a language geek
April 30th, 2006I think it had to happen, sooner or later. It’s just that I was not counting on it. Lately, after learning Ruby, I began to take a shine to other languages out there that I might be missing. I started reading up on Io, Lua and Haskell. Finally, I thought I should learn Lisp.
Why? I don’t know. I just wanted to learn it. I was looking for choices, and Rajesh who is doing this stuff for a while, pointed me to Practical Common Lisp. It looked like a good book, with a Jolt award to boot. But I was worried that I didn’t have exercises, so that I can see if I’m getting ahead. Finally, I settled on SICP . It’s one of those seminal books in computer science, which every engineer learns. Or is supposed to. It uses Scheme, a dialect of Lisp, to teach fundamental CS concepts. I thought I should give it a shot. So here I am, working through SICP. The exercises are really fun, some of them will make you really think. My first serious scheme code:
(define (goobledy a b c)
(if (> a b)
(if (< b c) (sum-of-squares a c) (sum-of-squares a b))
(if (< c b) (sum-of-squares a b) (sum-of-squares b c))))
What does it do? It just takes three numbers, prints out the sum of squares of the highest two. This solution doesn’t look all that DRY to me. I have to give it one more shot.
That code looks creepy
You ain’t seen nothin yet – check out the next posting