1
$\begingroup$

How can I create a list of bindings made to a certain variable when evaluating an expression? I want to determine three bindings made.

$\endgroup$
2
  • 1
    $\begingroup$ Trace[expr,i=_] $\endgroup$ Apr 21, 2014 at 22:52
  • 1
    $\begingroup$ Make a class that represents the variable (as say with Java's Integer class), with private array that keeps track of all assignments/time stamp/counters, etc.. all hidden inside the class, Supply a set[] and get[] methods to the clients of your variable to use on the variable once it is instantiated. Making such Class in M is very easy. Make a Module, and inside the Module create the local variables and private methods. see mathematica.stackexchange.com/questions/586/… for one example. $\endgroup$
    – Nasser
    Apr 22, 2014 at 1:29

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.