1 comment

[ 3.2 ms ] story [ 14.6 ms ] thread
The USE construct is trivial in Lisp:

    (defmacro use ((&rest vars) &body body)
      `(block nil
         (let ,(mapcar (lambda (sym) (list sym sym)) vars)
           ,@body)))
Example:

    (defun foo (x y)
      (+ (use (x)
           (incf x 10)
           (return (+ x y)))
         (use (y)
           (incf y 12)
           (return (+ x y)))))
-> 28