Archive for Scheme

How to be Smart

So after reading this blog for a little while, you’re probably wondering “How can I be as smart as this Trotter fella?” Well, let me clue you in on the secret of my skillz. I’m reading Structure and Interpretation of Computer Programs. It may be old, but wisdom never spoils. Read it and get smart.

Comments (3)

Quotation

After spending a little time with scheme’s concept of quotation, I must say that I really enjoy it. What makes quotation very nice is that it allows you to express new language constructs in the syntax of the original language. For instance, (+ x y) and ‘(+ x y) share the same syntax. The only difference is that the quotation in the second case prevents the expression from actually being evaluated.

I can already hear you screaming “Wait! What’s the difference between ‘(+ x y) and “(+ x y)”?!?!” Well my friends, the beauty of quotation is that you can use normal scheme’s normal list manipulation to parse ‘(+ x y). There is no need to go searching through strings to determine what is where. Instead, it’s all just a bunch of car’s and cdr’s.

Comments