2743 |
@deffnx {C Function} scm_gensym (prefix) |
@deffnx {C Function} scm_gensym (prefix) |
2744 |
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 |
2745 |
value. The string @var{prefix} can be specified as an optional |
value. The string @var{prefix} can be specified as an optional |
2746 |
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 |
2747 |
at each call. There is no provision for resetting the counter. |
at each call. There is no provision for resetting the counter. |
2748 |
@end deffn |
@end deffn |
2749 |
|
|
2750 |
The symbols generated by @code{gensym} are @emph{likely} to be unique, |
The symbols generated by @code{gensym} are @emph{likely} to be unique, |
2751 |
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 |
2752 |
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 |
2753 |
so. The 1.8 release of Guile will include a way of creating |
so. Uniqueness can be guaranteed by instead using uninterned symbols |
2754 |
symbols that are @emph{guaranteed} to be unique. |
(@pxref{Symbol Uninterned}), though they can't be usefully written out |
2755 |
|
and read back in. |
2756 |
|
|
2757 |
|
|
2758 |
@node Symbol Props |
@node Symbol Props |