Timeline for How to determine where a variable got assigned a value?
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Mar 17, 2016 at 1:57 | comment | added | Basheer Algohi | I don't know what do you mean be line number ( I suppose MMA does not have lines numbers). The message will block the kernel at the step where x is attempted to be assigned. see the answer bellow. | |
Mar 17, 2016 at 1:53 | answer | added | Basheer Algohi | timeline score: 1 | |
Mar 17, 2016 at 1:45 | comment | added | Seth | Would the message say the line number where this happened? Or appear in the notebook right after the assignment? That would be enough. Why don't you write it as an answer and I'll accept it unless something better comes along. | |
Mar 17, 2016 at 1:40 | comment | added | Basheer Algohi |
I don't think you can get history of usage of symbol. The new assignment erase the previous one and that is what you got. But you can create a function (at the beginning ) which gives you message when x is assigned to any value.
|
|
Mar 16, 2016 at 23:20 | comment | added | Seth |
Now that x has been cleared, this only returns x (with no history). I'll try it out next time it unexpectedly has a value to see if it works then.
|
|
Mar 16, 2016 at 23:14 | comment | added | J. M.'s missing motivation♦ |
Why not do something like TracePrint[(* expr *), _Set | _SetDelayed] ?
|
|
Mar 16, 2016 at 23:03 | history | asked | Seth | CC BY-SA 3.0 |