News for hackers. Stuff that matters.
Re:History of T (2001) by nils-m-holm on Saturday August 18, 2018 @07:06AM (#17787949)
And even in the LISPs that did give up dynamic binding, you can still emulate it to some degree. E.g. in Scheme:

  (define-syntax fluid-let
    (syntax-rules ()
      ((_ () x . xs)
        (begin x . xs))
      ((_ ((v1 a1) (v2 a2) ...) x . xs)
        (let ((tmp v1))
          (set! v1 a1)
          (fluid-let ((v2 a2) ...)
            (let ((r (begin x . xs)))
              (set! v1 tmp)
              r))))))

  (define x 'foo)
  (define (f) x)

  (f) ==> foo

  (fluid-let ((x 'bar))
    (f))                ==>  bar

There are no comments on this comment yet.