Comment on Open Thread: July 2010, Part 2

Tue, 13 Jul 2010 05:40:21 GMT

While we're sharing fun information, I'd like to point out a little-used feature of Markdown syntax: if you put four spaces before a line, it's treated as code. Behold:

(define (make-counter)
  (let ([internal-variable 0])
    (lambda ()
      (begin (set! internal-variable (+ internal-variable 1))
         internal-variable))))

Also, the emacs rectangle editing functions are good for this. C-x r t is a godsend.

Discuss