News for hackers. Stuff that matters.
Re:History of T (2001) by pvg on Saturday August 18, 2018 @02:34AM (#17787195)
They also did not have first-class functions.

Sure, for some values of 'did not'. What I'm getting at is (and I think, if I'm reading you right, so are you) this debate existed in a fairly specialized universe. There wasn't a time in the 80s where statistically anybody was grappling with the choice of lexical over dynamic scoping, at least, not for programs most people wrote or used. Block-structured languages were already the norm by then.

Re:History of T (2001) by lispm on Saturday August 18, 2018 @04:26AM (#17787481)
The dynamic binding 'debate' began in the Lisp community in the 60s. Some functional programming language designers and people thinking about implementing them also explored it then.

See: The Funarg problem, 1968 http://www.softwarepreservation.org/projects/LISP/MIT/Weizen...

Mid 70s Scheme then was the first dialect to use lexical binding as a default. From then on new dialects of Lisp or new versions of of it switched over time to lexical binding by default. Scheme names block-structured Algol as one of its influences. 1982 Common Lisp was initially described amd it was then also using lexical binding.

The primitive block structured languages like PASCAL had it from Algol, too. But it was not a big deal, because they had no Closures, were not using Interpreters, had first class functions, no higher-order functions, etc. Lisp users were looking to implement higher-order functions in a 'right' way.

But most Lisps never gave up to provide dynamic binding as a feature, since it is used in a lot of programs...

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