#20: Uninitialized Locals

Tagged as challenge

Written on 2018-01-30

Write a macro locals which acts sort of like let, but allows uninitialized values. (If your language doesn't support uninitialized variables, then you can bind them to your false value, like #f in Scheme.) For example:

(locals (a b (c 1) d)
  (set! a 5)
  (+ a c))

==> 6

Unless otherwise credited all material copyright © 2010–2018 by Robert Smith