(cons calculus (cdr ‘(eating is fun)))
Last night I spent an hour or so working through Calculus and Pizza: A Cookbook for the Hungry Mind. While I don’t care so much for all the pizza/food stuff (extra fluff that gets in the way of what I’m after), the math is good. I’ve relearned how to do derivatives, find local minima and maxima, use the chain rule and extended power rule, and so on. Still haven’t gotten to integrals yet, though. The calculus is pretty easy, I must admit; the only thing that keeps hanging me up is the algebra. Most of the algebra is a piece of cake, of course, but there are little bits and pieces here and there that I keep forgetting. But it’s coming back.
After that, I picked up The Little Schemer and spent a most enjoyable two hours working through the first 80 pages. At first I didn’t intend to actually write all of the little functions you’re expected to write, but I’m glad I did. And to my small surprise, I was able to write all of them without too much trouble. We’re talking functions like +, -, >, and < , folks. Simple stuff. It’s like writing the language from scratch yourself. (Yes, I know there’s more truth to that than there may seem at first. :))
The coolest thing is learning how to solve problems recursively rather than iteratively. Sure, some of this stuff would be far easier using a for loop, but using recursion like this means no side effects (at least if I understand correctly), and that’s sweet. I can’t wait to finish the rest of the book and move on to The Seasoned Schemer. (And I’ll be glad when we move on to higher-level programs, too.)
Oh, the parentheses in Scheme don’t bother me at all — in fact, I rather like them. :)




Technorati Tags:
Posted in