std-gensym | ![]() |
Create a new unbound symbol. Subsequent calls will create new unbound symbols. The name of the symbol will be "G" plus the string representation of the number *GENSYM-COUNTER*. The initial value of *GENSYM-COUNTER* is 0, the first call of (std-gensym) will return the symbol G0, subsequent calls G1, G2 and so on.
This function may be useful to create dynamically temporary anonymous symbols or functions.
It is not explicitly forbidden to set *GENSYM-COUNTER*, but it must be a integer value then.
Note
This behaviour changed after version 0.3013. Before it didn't create fresh symbols which made CL-like coding complicated.
AutoLISP has a completely broken behaviour of the BOUND predicate. In AutoLISP bound is the same as (not (null)), in normal lisp it tells if the symbol exists regardless if it's nil or not. In Lisp a symbol may be both: bound and nil, in AutoLISP this isimpossible.
(setq x (std-gensym)) => G0 (eval x) => nil (std-gensym) => G1
(set (std-gensym) 1) => 1
;side-effect: creates G2
(eval x) => nil
None
A new symbol.
Increments *GENSYM-COUNTER* by one.
(std-require 'STDLISP)
Defined in STDLISP.