To remove a symbol, I can write:
y=6;
mySymbol = Expr(y);
//Delete Symbols("y");
////Delete Symbols(y); // <- easy
Eval(Eval Expr(Delete Symbols(Expr(Name Expr(mySymbol)))));
Show symbols()
If I need to remove a symbol from a namespace, I need the string of the symbol:
Names Default To Here( 1 );
nsref = New Namespace(
"ns"
);
ns:x = 20;
mySymbol = Expr( x );
//nsref << Remove("x")
Eval(
Substitute(
Expr(
nsref << Remove( _sym_ )
),
Expr( _sym_ ), Substitute( Expr( Char( __sym__ ) ), Expr( __sym__ ), Name Expr( mySymbol ) )
)
);
s = NameExpr( mySymbol );
str = Char(s) ); // Name not defined
Show( str );
What is the right syntax for
Char(s)
?