Timeline for Functions that creates symbol in a specific context
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 4, 2013 at 19:33 | comment | added | Leonid Shifrin | @QuantumMathematica Yes indeed, on a fresh kernel it does work. | |
Apr 4, 2013 at 18:56 | comment | added | Oleksandr R. |
It does work for me. But, invoking f twice for the same symbol will produce an error. You need to take Leonid's approach of using ToExpression rather than Symbol if you want to avoid that.
|
|
Apr 4, 2013 at 18:46 | comment | added | MaTECmatica | Really? Maybe if you do a ClearAll[f], or restart a new, fresh Mathematica session? or give the function another name? I am guessing your old definition for f is in conflict with the one I propose. Notice the idea is the same as the one by Leonid, give the name as a string "myvar" instead of myvar | |
Apr 4, 2013 at 18:36 | history | answered | MaTECmatica | CC BY-SA 3.0 |