I'm officially scared now...

ziggy on 2001-12-05T14:07:49

Last night I was dreaming in Scheme.

I've finally grasped the idea of "syntactic forms", and thought about a nice concise syntactic form for defining objects with single inheritance. (Another confession: I'm in the midst of Kent Dybvig's The Scheme Programming Language, and that must have something to do with it...)

It would also be kinda neat to write an XML Parser suite completely from scratch in Scheme, including SAX handlers that properly pass events through the chain. DOM builders would be nice, too. But I mean "neat" in the sense of "it would be an interesting academic exercise where the journey is the reward sorta thing, but I probably won't do it because I'd rather run a marathon than do that kind of exercise".

And, as if that wasn't enough, simple continuations are starting to make sense now:

(define retry #f)

(define factorial
  (lambda (x)
    (if (= x 0)
        (call/cc (lambda (k) (set! retry k) 1))
        (* x (factorial (- x 1))))))