|
From: Raymond T. <toy...@gm...> - 2025-02-12 01:57:21
|
On Tue, Feb 11, 2025 at 9:59 AM Leo Butler <Leo...@um...> wrote: > On Mon, Feb 10 2025, Raymond Toy <toy...@gm...> wrote: > > > On 2/10/25 2:05 PM, Leo Butler wrote: > >> On Mon, Feb 10 2025, Raymond Toy<toy...@gm...> wrote: > >> > >>> On 2/10/25 9:36 AM, Raymond Toy wrote: > >>> > >>>> On 2/10/25 8:12 AM, Raymond Toy wrote: > >>>> > >>>>> On 2/5/25 10:51 AM, Leo Butler wrote: > >>>>> > >>>>> > >>>>> An aside: Why is there the list |*builtin-symbols-with-values*| and > >>>>> also the hash table |*builtin-symbol-values*|. Can't we just use > >>>>> the hash table? One less thing to keep synchronized. I assume they > >>>>> are, but I didn't check. > >>>>> > >>>> I looked. init-cl has this: > >>>> > >>>> |(dolist (s *builtin-symbols*) (when (boundp s) (push s > >>>> *builtin-symbols-with-values*))) (dolist (s > >>>> *builtin-symbols-with-values*) (setf (gethash s > >>>> *builtin-symbol-values*) (symbol-value s))) | > >>>> > >>> While looking at this, I see that it seems that |*builtin-symbols*| > >>> basically has the same info as |*builtin-symbol-props*|. We could > >>> probably get rid of |*builtin-symbols*| as well, once suprv1.lisp is > >>> updated to use the hashtable instead of the list. Again, suprv1.lisp > >>> uses |member| with a test of |equal|. I think |eql| or even |eq| would > >>> have worked. Of course, this won't matter if we use the hashtable, > >>> which defaults to |eql| . > >>> ​ > >> I saw that there were 4 variables that look like they could all be > >> consolidated into a single hashtable, maybe > >> *BUILTIN-SYMBOLS-WITH-VALUES*? Looking with `magit-blame', it looks like > >> the 4 variables are quite old... > > Don't we need one for values, as you mention, and also one for the > > properties? > > You are likely right. > > An alternative, though, would be to store both values and properties in > an alist for each symbol. Perhaps that is too much work, though. > We could do that as well. I think I like two hashtables, but could be easily convinced that one is better. I also found out that there's `*variable-initial-values*`. Not exactly sure how that differs from `*builtin-symbols-with-values*`, but the former is used by `reset` to reset the value of a variable. This also explains why `file_search_maxima` isn't reset: it's not in the hashtable. It probably should be. In any case, I think I'll file a bug that all these things should be rationalized/consolidated if possible. > > Leo > > >> > >> On a slightly different note, I cannot find a single variable that has > >> the ASSIGN property set to SPECIAL. Indeed, this form > >> > >> (let (x) (do-symbols (s :maxima x) > >> (when (let ((w (get s 'assign))) > >> (or (and (listp w) (member 'special w)) (eq w 'special))) > >> (push s x)))) > >> > >> returns NIL. (By contrast, when SPECIAL is replaced by NEVERSET, I get a > >> list of length 26.)' > > That's what I saw too; no symbols with a property of special. > >> > >> I think we can safely replace the case in REMVALUE which checks if X has > >> the SPECIAL property with a hash-table lookup in > >> *BUILTIN-SYMBOLS-WITH-VALUES*. > >> > >> WDYT? > >> > >> Leo > > -- > --- > Best regards, > Dr Butler -- Ray |