The command With[{x = 1}, x] outputs 1.
The command t = x; With[{x = 1}, t] outputs x.
I expected this second input to give the same answer. How can I modify my code so it behaves in this way?
The command With[{x = 1}, x] outputs 1.
The command t = x; With[{x = 1}, t] outputs x.
I expected this second input to give the same answer. How can I modify my code so it behaves in this way?
I think you are confusing the behaviour of With and Block
t = x; Block[{x = 1}, t]
(* 1 *)
t=x; With[{x=1}, {x, t}]. – J. M.'s missing motivation Nov 11 '15 at 14:05