(gensym (? tag)) tag: any type (optional) returns a sym
Constructs a unique symbol.
The symbol returned from this function is guaranteed to compare unequal to all other symbols. This can be useful for maintaining macro hygiene.
backquote has an "auto-gensym" feature which may be more convenient than
gensym function directly.
tag is present, it's converted into a string which is incorporated into the
gensym's printed representation. This can be helpful for debugging.
(prn (gensym)) ; prints #<gs:0> (prn '#<gs:0>) ; error: #<gs:0> is invalid syntax (prn (gensym 'tagged)) ; prints #<gs:tagged:1>