makeSymbol
makeSymbol(S_createSymbol[t_namespaceArg] ) =>s_result
Description
Creates a symbol corresponding to the specified symbol or character string. You can optionally specify the namespace name (t_namespace) in which you want to create the symbol.
The function gensym() also creates symbols. However, the symbol names are determined internally (and are therefore unique) whereas in the case of makeSymbol() the symbol name depends upon the string passed as a parameter to the function.
Arguments
|
Specifies the value for which a corresponding symbol needs to be created. |
|
|
Specifies the name of the namespace in which you want to create the symbol. |
Value Returned
Examples
The following example creates a symbol corresponding to the specified string value, myString.
makeSymbol(“myString”)
=> myString
The following example usesd an increment counter (count) to create unique symbols (myString1, myString2, and so on)
count=0
makeSymbol(strcat("myString" sprintf(nil "%L" ++count)))
The following example creates a symbol, myString, in the namespace, newNamespace.
makeNamespace("newNamespace")
makeSymbol("myString" "newNamespace")
=> newNamespace:::myString
Related Topics
Return to top