Is there any method by which it is possible to pass a pointer in Mathematica?
As an example, if we define the function:
And then define the variable:
And then call func with our definition:
This will give an error because ''func'' only gets the value of ''val'', not a pointer to it. In most cases (especially in
functional programming) this is fine, but without this capability it becomes necessary to rewrite functions from, say,
C or C++.
I have tinkered with pure functions, but I can't seem to duplicate this functionality.