Re: $gensym
Henry Baker <[email protected]>
| Newsgroups | gmane.comp.mathematics.maxima.general,gmane.lisp.gcl.devel |
|---|---|
| Message-ID | <[email protected]> |
I would love it if Maxima 'gensym' could take *both* a 'prefix' and
a non-negative number in order to gensym symbols like 'k123', etc.
I'm currently generating huge numbers (~100?) of variable symbols --
e.g., whole arrays' worth -- in order to solve (linear) Sylvester matrix
equations, and it would be nice if I could have different prefixes for
different types of variables.
I can do this myself, but I thought others might want the same
capability.
Since prefixes and numbers have different types, a backwards-
compatible solution might be to simply have multiple arguments:
gensym("k",123) and/or gensym(123,"k") -- i.e., in either order.
-----Original Message-----
From: Camm Maguire <[email protected]>
Sent: Nov 5, 2023 7:46 AM
To: Robert Dodier <[email protected]>, <[email protected]>, <[email protected]>
Cc: <[email protected]> <[email protected]>
Subject: [Maxima-discuss] $gensym
Greetings! Just to report that maxima's current use of $gensym (at
least as of commit b6d66ad4e which is doubtless out of date by now)
creates an implicit dependency on an unchanged *gensym-counter* binding,
i.e. that the sequence of lisp gensym names are presented to $gensym in
the conventional order. Should an implementation reset the outer
binding of *gensym-counter*, this will generate test suite failures. I
have a test case if anyone is interested. The ansi spec says
*gensym-counter* can be either assigned or bound at any time, but its value must always be a non-negative integer.
This is obviously not too important, and gcl will make sure to stay
clear of this for maxima's sake.
Take care,
--
Camm Maguire [email protected]
==========================================================================
"The earth is but one country, and mankind its citizens." -- Baha'u'llah
_______________________________________________
Maxima-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maxima-discuss