convert an expression to a local name
expression; name, string, or symbol
An expression e (typically itself a symbol or string) can be converted to a local name using the convert( e, '`local`' ) calling sequence. The expression returned is of type symbol, and is guaranteed to be unequal to any name at the same scope in which the call is made. If the expression e is a symbol, then the symbol returned by this conversion has the same external representation as e, but is distinct from e. (See the examples.)
Note that, because it is a Maple keyword, the name local must be enclosed in left single quotes, as demonstrated by the examples below.
p := proc()
evalb( t = convert( t, '`local`' ) )
p ≔ proclocalt;evalb⁡t=convert⁡t,'local'end proc
Even when called on the same argument within the same scope, distinct calls yield distinct names.
q := proc()
evalb( convert( t, '`local`' ) = convert( t, '`local`' ) )
This is also true for module scopes.
m := module()
export e, try1, try2;
try1 := proc() evalb( e = convert( e, '`local`' ) ) end proc;
try2 := proc() evalb( t = convert( t, '`local`' ) ) end proc;
This facility can be used to generate a collection of distinct objects all of which look the same.
Download Help Document
What kind of issue would you like to report? (Optional)