New answers tagged assignment
3
This seems rather convoluted, and there is almost certainly an easier way to approach whatever it is you are wishing to do, but I like answering questions like this as it allows working with more unusual aspects of the language.
We can do this:
Block[{tmp, Part}, Hold @@ {test[2]}] /. _[x_] :> (x = {111, 222});
As with my previous answer we may wish ...
3
I would approach this by combining the functionality of bump given in:
Elegant manipulation of the variables list
with my step evaluation function described here:
How do I evaluate only one step of an expression?
The step function is needed to (easily) recover the expression {ttt[[1]], ttt[[2]]} from the definition of f without it fully evaluating. It can ...
3
You may use ReleaseHold[Hold[f = {3, 4}] /. OwnValues[f]] :
ttt = {1, 2};
f := {ttt[[1]], ttt[[2]]};
ReleaseHold[Hold[f = {3, 4}] /. OwnValues[f]]
?ttt
(* ttt -> {3,4} *)
Some explanations :
The fullform of f={3,4} is Set[f, List[3, 4]].
Set has attribute Holdfirst.
We want to transform Set[f, List[3, 4]] in {ttt[[1]], ttt[[2]]}={3,4}.
...
2
For Example:
(Let's define some data*)
t20 = Range@10;
J20 = RandomReal[{0, 1}, 10];
tabt20 = Transpose[{t20, J20}]; (*better than your Table[] !*)
Intt20 = Interpolation[tabt20]; (*Interpolate*)
Intt20[3.3] (*calc it at some point *)
Plot[Intt20[x], {x, 1, 10}] (* plot it *)
2
Will some dynamic chart fit your needs?
I tried using dynamic things to track the change of variable values as followed.
First of all I need to filter out those context I'm not interested in. Unfortunately I don't know how to get built-in contexts, so I used a silly way, that is to run some random code before reading contexts:
Names["*`x"];
{Plot[x, {x, ...
10
General thoughts
I think that your mechanism is reasonably robust for common use cases, but not fully robust if one wants to take into account all possible ways that the value (or, generally, global properties) of the symbol can be changed in Mathematica.
My current opinion is that making such triggering mechanism fully robust without new system support is ...
Top 50 recent answers are included

