mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-30 00:40:20 +02:00
(Symbol Primitives): In gensym, cross reference
uninterned symbols, use @w{} on " g" prefix to avoid any chance of a line break obscuring it.
This commit is contained in:
parent
2886a77502
commit
90a5894d05
1 changed files with 4 additions and 3 deletions
|
@ -2743,15 +2743,16 @@ code. The @code{gensym} primitive meets this need:
|
||||||
@deffnx {C Function} scm_gensym (prefix)
|
@deffnx {C Function} scm_gensym (prefix)
|
||||||
Create a new symbol with a name constructed from a prefix and a counter
|
Create a new symbol with a name constructed from a prefix and a counter
|
||||||
value. The string @var{prefix} can be specified as an optional
|
value. The string @var{prefix} can be specified as an optional
|
||||||
argument. Default prefix is @samp{ g}. The counter is increased by 1
|
argument. Default prefix is @samp{@w{ g}}. The counter is increased by 1
|
||||||
at each call. There is no provision for resetting the counter.
|
at each call. There is no provision for resetting the counter.
|
||||||
@end deffn
|
@end deffn
|
||||||
|
|
||||||
The symbols generated by @code{gensym} are @emph{likely} to be unique,
|
The symbols generated by @code{gensym} are @emph{likely} to be unique,
|
||||||
since their names begin with a space and it is only otherwise possible
|
since their names begin with a space and it is only otherwise possible
|
||||||
to generate such symbols if a programmer goes out of their way to do
|
to generate such symbols if a programmer goes out of their way to do
|
||||||
so. The 1.8 release of Guile will include a way of creating
|
so. Uniqueness can be guaranteed by instead using uninterned symbols
|
||||||
symbols that are @emph{guaranteed} to be unique.
|
(@pxref{Symbol Uninterned}), though they can't be usefully written out
|
||||||
|
and read back in.
|
||||||
|
|
||||||
|
|
||||||
@node Symbol Props
|
@node Symbol Props
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue