I'm having trouble defining a function where I previously treated a variable as a parameter. See the following example:
var := 2*a
f[a_] := var
Then f[a]
returns 2a
but f[2]
only returns f[2]
without evaluation. I understand I could just define var
as a function of a
but this is unwieldy for the number of parameters I am using. Is there a function that will 'dereference' var
?