Arc Forumnew | comments | leaders | submitlogin
1 point by rntz 5896 days ago | link | parent

Code very similar to this was posted on this forum before, I think by almkglor, but I don't think it made its way to anarki. I'm using it and I think it's quite useful, so I put it there. Use is pretty self-explanatory:

    (set foo 'global)
    (let foo 'local (eval 'foo))
    => global
    (let* foo 'local (eval 'foo))
    => local

    (set foo nil)
    (slet foo 1 (slet foo 2 (eval 'foo)))
    => (2 1)

    (dynvar input&)
    (def read1 () (read input&))
    (let* (input-stream&) "foo" (read1))
    => foo