[Top][All Lists]

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

Re: How do I pass a variable defined in a wrapping let, to a lambda?

From: Emanuel Berg
Subject: Re: How do I pass a variable defined in a wrapping let, to a lambda?
Date: Sat, 12 Mar 2022 03:18:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Michael Heerdegen wrote:

> you may want to find out what evaluating lexical-binding in
> the buffer with lexical-binding -> nil gives you.
> Second: (AFAIK...) be sure to reeval `steinars-test' with
> lexical-binding -> nil. `steinars-test' defined using the
> lexical binding dialect will return a closure even when
> called in the dynamcially binding dialect.

This is an example of why I think there should be three `let':

* "let" that is static/lexical except for already-defined
  dynamic/special variables (i.e., what `let' is already under
  static/lexical scope, so won't break any code to change.
  well, there wouldn't be any change except static/lexical
  would be default everywhere)

* "dlet" that is always dynamic/special

* "slet" that is always static/lexical

Then we could get rid of the ugly and impractical cookie:

  ;;; -*- lexical-binding: t -*-

The insistence on "dlet" would break code for people w/o the
cookie who expects `let' do be dynamic/special, however it is
only good they are forced to be explicit with that and besides
it is only one `replace-regexp' away anyway ... all the way!

underground experts united

reply via email to

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