Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

gensym

gensym( 
[ S_arg ] 
) 
=> s_result

Description

Returns a new symbol based on the input argument.

The new symbol’s print name is the result of concatenating the printed representation of the argument, or “G” if no argument is given, and the printed (decimal) representation of a number. The returned new symbol is unique in the sense that it does not exist at the time this function is called.

Arguments

S_arg

String or symbol to be concatenated into a new symbol. If not supplied, the default value is G.

Value Returned

s_result

New unique symbol.

Examples

gensym()                 
=> G5
gensym("test")           
=> test6
test7 = 10               
=> 10      ;test7 exists now.
gensym('test)            
=> test8   ;test7 is skipped.
gensym() == gensym()     
=> nil     ;Always returns nil.

Related Topics

Core Functions


Return to top
 ⠀
X