[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: master 9c82f480590: Move and edit text about lexical environment rep
From: |
Mattias Engdegård |
Subject: |
Re: master 9c82f480590: Move and edit text about lexical environment representation |
Date: |
Sun, 22 Oct 2023 10:03:46 +0200 |
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