If you read Matthias Felleisen’s blog post today about using call/cc to write a generator, and you’re anything like me, you must have thought “Ruby has call/cc; how would I do this in Ruby?”
This is my first pass. It works, but it could very well be broken, and I know it can have a better [...]
Monthly Archives: July 2007
`call/cc’ and Self-modifying Code, in Ruby
July 28, 2007 – 5:13 am
Function-scope state in JavaScript
July 20, 2007 – 2:02 am
I needed to write some JavaScript that toggles its output. In Scheme it looks like this:
(define img-toggler
(let ((down? #t))
(lambda ()
(if down?
(begin (set! down? #f)
[...]