* Re: master 9c82f480590: Move and edit text about lexical environment representation
[not found] ` <20231021111111.809E3C09BDB@vcs2.savannah.gnu.org>
@ 2023-10-22 4:47 ` Michael Heerdegen
2023-10-22 8:03 ` Mattias Engdegård
0 siblings, 1 reply; 5+ messages in thread
From: Michael Heerdegen @ 2023-10-22 4:47 UTC (permalink / raw)
To: emacs-devel; +Cc: Mattias Engdegård
Hello Mattias,
> +Lisp debuggers. Each member of the list is either a cons cell which
> +represents a lexical symbol-value pair, or a symbol representing a
> +dynamically bound variable.
I have two questions/things that are unclear to me: First, the docstring
of `eval' talks about LEXICAL as an "alist mapping" which seems not to
be exact if it is allowed to contain plain symbols. Should the
docstring be clarified as well?
Second: you wrote "or a symbol representing a dynamically bound
variable". Does this variable really have to be bound (to a value), or
do you mean "dynamically binding" (aka special)? And such a member VAR
in LEXICAL means that the VAR is special when FORM is evaluated - even
when the variable has not been declared special in the outer
context...or something else?
TIA,
Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: master 9c82f480590: Move and edit text about lexical environment representation
2023-10-22 4:47 ` master 9c82f480590: Move and edit text about lexical environment representation Michael Heerdegen
@ 2023-10-22 8:03 ` Mattias Engdegård
2023-10-23 3:50 ` Michael Heerdegen
0 siblings, 1 reply; 5+ messages in thread
From: Mattias Engdegård @ 2023-10-22 8:03 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: emacs-devel
22 okt. 2023 kl. 06.47 skrev Michael Heerdegen <michael_heerdegen@web.de>:
>> +Lisp debuggers. Each member of the list is either a cons cell which
>> +represents a lexical symbol-value pair, or a symbol representing a
>> +dynamically bound variable.
>
> I have two questions/things that are unclear to me: First, the docstring
> of `eval' talks about LEXICAL as an "alist mapping" which seems not to
> be exact if it is allowed to contain plain symbols. Should the
> docstring be clarified as well?
Probably, yes. Doc strings are often somewhat simplified but a little accuracy wouldn't cost us much here.
> Second: you wrote "or a symbol representing a dynamically bound
> variable". Does this variable really have to be bound (to a value), or
> do you mean "dynamically binding" (aka special)?
The latter: it represents a (defvar SYMBOL) declaration at that point.
The parameter has exactly the same type as internal-interpreter-environment which is described in a comment in eval.c.
> And such a member VAR
> in LEXICAL means that the VAR is special when FORM is evaluated - even
> when the variable has not been declared special in the outer
> context...or something else?
No, you are right. Example:
(defun pz () (defvar z) z)
(eval '(let ((z 3)) z) t) => 3
(eval 'z '((z . 4))) => 4
(eval '(let ((z 5)) (pz)) t) => (void-variable z)
(eval '(let ((z 6)) (pz)) '(z)) => 6
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: master 9c82f480590: Move and edit text about lexical environment representation
2023-10-22 8:03 ` Mattias Engdegård
@ 2023-10-23 3:50 ` Michael Heerdegen
2023-10-23 12:52 ` Mattias Engdegård
0 siblings, 1 reply; 5+ messages in thread
From: Michael Heerdegen @ 2023-10-23 3:50 UTC (permalink / raw)
To: Mattias Engdegård; +Cc: emacs-devel
Mattias Engdegård <mattiase@acm.org> writes:
> > I have two questions/things that are unclear to me: First, the docstring
> > of `eval' talks about LEXICAL as an "alist mapping" which seems not to
> > be exact if it is allowed to contain plain symbols. Should the
> > docstring be clarified as well?
>
> Probably, yes. Doc strings are often somewhat simplified but a little
> accuracy wouldn't cost us much here.
Ok. Should you find some time, maybe you could do that?
> > Second: you wrote "or a symbol representing a dynamically bound
> > variable". Does this variable really have to be bound (to a value), or
> > do you mean "dynamically binding" (aka special)?
>
> The latter: it represents a (defvar SYMBOL) declaration at that point.
> The parameter has exactly the same type as
> internal-interpreter-environment which is described in a comment in
> eval.c.
Is "dynamically bound" a good choice of language, then, or would
"dynamically binding" or something else (like "indicating that this
variable should use dynamic scoping" in the comment you mentioned) be
a bit clearer?
> No, you are right. Example:
>
> (defun pz () (defvar z) z)
>
> (eval '(let ((z 3)) z) t) => 3
> (eval 'z '((z . 4))) => 4
> (eval '(let ((z 5)) (pz)) t) => (void-variable z)
> (eval '(let ((z 6)) (pz)) '(z)) => 6
Thanks. Ok, good, that's all as expected.
Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: master 9c82f480590: Move and edit text about lexical environment representation
2023-10-23 3:50 ` Michael Heerdegen
@ 2023-10-23 12:52 ` Mattias Engdegård
2023-10-24 2:12 ` Michael Heerdegen
0 siblings, 1 reply; 5+ messages in thread
From: Mattias Engdegård @ 2023-10-23 12:52 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: emacs-devel
23 okt. 2023 kl. 05.50 skrev Michael Heerdegen <michael_heerdegen@web.de>:
> Ok. Should you find some time, maybe you could do that?
Certainly, now done. I also updated the manual entry for `eval` for accuracy.
Thank you for your kind and useful comments!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: master 9c82f480590: Move and edit text about lexical environment representation
2023-10-23 12:52 ` Mattias Engdegård
@ 2023-10-24 2:12 ` Michael Heerdegen
0 siblings, 0 replies; 5+ messages in thread
From: Michael Heerdegen @ 2023-10-24 2:12 UTC (permalink / raw)
To: Mattias Engdegård; +Cc: emacs-devel
Mattias Engdegård <mattiase@acm.org> writes:
> Certainly, now done. I also updated the manual entry for `eval` for
> accuracy.
LGTM. Thank you Mattias.
Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-10-24 2:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <169788667120.25632.15745430411138121616@vcs2.savannah.gnu.org>
[not found] ` <20231021111111.809E3C09BDB@vcs2.savannah.gnu.org>
2023-10-22 4:47 ` master 9c82f480590: Move and edit text about lexical environment representation Michael Heerdegen
2023-10-22 8:03 ` Mattias Engdegård
2023-10-23 3:50 ` Michael Heerdegen
2023-10-23 12:52 ` Mattias Engdegård
2023-10-24 2:12 ` Michael Heerdegen
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).