help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [External] : Re: Lexical vs. dynamic: small examples?


From: Drew Adams
Subject: RE: [External] : Re: Lexical vs. dynamic: small examples?
Date: Sun, 15 Aug 2021 15:49:31 +0000

> (OK, it _is_ lexical binding for the arguments and dynamic
> for the globals but has this any practical implications?)

As I said, `let' (in both Elisp and Common Lisp) binds
"special" vars dynamically and non-special vars lexically.
There's nothing else to it.

> No, the only thing I've seen so far - maybe the only thing it
> is? - is `let', and that acts in two ways, the lexical way if
> one puts
> 
> ;;; -*- lexical-binding: t -*-
> 
> first thing in the source file, and if one doesn't, it acts in
> the dynamic way.

See above.  In Elisp we have var `lexical-binding', and
lexical binding is not not turned on by default.  With
Common Lisp there's no such variable, and the effect is
as if `lexical-binding' were always non-nil.  (There are
other differences, wrt how/where you can declare vars to
be "special".)

> So I wonder again, why not just have two let, one "let-stay"
> (the variables stay so has to be used and/or passed
> explicitely), and "let-follow" (the variables follow
> everywhere the code goes within the let form).

Sorry, I don't follow you.  It's not clear to me what
you're proposing or (more importantly) what problem
you think you have with the designed behavior.

<<attachment: winmail.dat>>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]