Newbie Question: Are arguments in a function definition bound when function is called?
Subject: Newbie Question: Are arguments in a function definition bound when function is called?
From: Richard Fateman
Date: Wed, 26 Aug 2009 08:14:41 -0700
Well, no need to get upset; Stavros' explanation said it all, in some
sense.
You can't cover over the functional meaning of a built-in function by a
value binding.
g(sin):=sin(sin).
g(%pi/2) ---> 1
It is not (%pi/2) viewed as a function
applied to the argument (%pi/2) as an argument.
It is sin, the built-in function, applied to the value %pi/2
Actually, the function name need not be built-in, but any function.
Inside the body of g, above, the name sin is used as a function and
as a value. They are different.
If you want to use the VALUE of a name as a function, try apply(f,[x]).
Let's try
h(sin):= apply(sin,[sin]);
h(f) --> f(f)
h(%pi/2) --> error, improper name or value in functional position, %pi/2
I hope this helps.