[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
dlet/let/slet (was: Re: [External] : How to create a higher order functi
From: |
Emanuel Berg |
Subject: |
dlet/let/slet (was: Re: [External] : How to create a higher order function?) |
Date: |
Tue, 05 Oct 2021 11:53:12 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
>> You mean you could use the same variable sometimes with
>> `slet', sometimes with `dlet'?
>
> Yes, with `dlet' and `let' it would/could be that way - with
> "slet" it would _always_ be static/lexical so then it would
> be "same variable name" rather ...
That's it, that's what we should have!
dlet - special/dynamic, always
let - special/dynamic on existing such variables, otherwise
static/lexical
slet - static/lexical, always
So dlet would be the same as `let' today if `lexical-binding'
is nil, which is the default.
And let would be the same as `let' today if `lexical-binding'
is t, which is recommended for everyday Elisp use.
Then there would be no need for ;;; -*- lexical-binding: t -*-
and no confusing alternating behavior for `let' and if you
wanted to explain/learn about dlet, let, and slet one would
just go to their individual docstrings, i.e. no need for CS
theory with respect to scoping or anything, they would just be
three Lisp functions (or special forms) among all other ...
--
underground experts united
https://dataswamp.org/~incal