diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-11-03 19:45:16 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-11-03 19:45:16 -0700 |
commit | 508859b5ef25d0bdf702c3ab0c710f4a96d761dc (patch) | |
tree | b1557015625690f4affd36983b4fe09a77cef185 | |
parent | 8b073128756a3a1d0d7b151399101ee2a6e52ef1 (diff) | |
download | txr-508859b5ef25d0bdf702c3ab0c710f4a96d761dc.tar.gz txr-508859b5ef25d0bdf702c3ab0c710f4a96d761dc.tar.bz2 txr-508859b5ef25d0bdf702c3ab0c710f4a96d761dc.zip |
doc: gensym documentation.
* txr.1: The gensym function's argument doesn't have to be a
string. Plus other wording fixes.
-rw-r--r-- | txr.1 | 32 |
1 files changed, 17 insertions, 15 deletions
@@ -62129,7 +62129,6 @@ It creates and returns a new symbol object. If the .meta prefix argument is omitted, it defaults to .strn g . -Otherwise it must be a string. The difference between .code gensym @@ -62137,23 +62136,26 @@ and .code make-sym is that .code gensym -creates the name -by combining the prefix with a numeric suffix. - -The numeric suffix is a decimal digit string, taken from the value of -the variable -.codn *gensym-counter* , -after incrementing it. +creates the symbol's name +by combining the +.meta prefix +with a numeric suffix. The suffix is obtained by incrementing the +.code *gensym-counter* +and taking the new value. +The name string then calculated from the prefix and the counter value +as if by evaluating a form similar to +.codn "(fmt \(dq~a~,04d\(dq prefix counter)" . +From this it can be inferred that +.meta prefix +can be an object of any kind. -Note: the variation in name is not the basis of the uniqueness assurance -offered by -.code make-sym -and -.codn gensym ; -the basis is that the returned symbol is a freshly instantiated object. +Note: the generated symbol's name, though varying thanks to the incrementing +counter, is not the basis of its uniqueness. The basis of the symbol's +uniqueness is that it is a freshly created object, distinct from any other +object. The related function .code make-sym still returns unique symbols even if repeatedly called with the same -string. +string argument. .coNP Special variable @ *gensym-counter* .desc |