On 12/6/2009 3:49:02 PM, Tom_Gutman wrote:
>The for loop in the program is
>meaningless. You are defining
>u as a local function with a
>formal parameter of x. The
>value of x in the environment
>of that definition is
>irrelevant.
Note that u is
>defined as a function. So in
>version 1 you have defined
>displacement as a function (of
>one variable) and
>displacement(x) is a number,
>depending on x.
In version 2
>you have defined displacement
>as a function of one variable
>that returns a function (u) of
>one variable. As you do not
>ever use the value of the
>formal parameter x in the
>definition of displacement, it
>returns the same value (a
>function) regardless of the
>passed value of x. Now
>displacement(x) is a function
>of one variable and is not a
>value.
Further note that due
>to the implicit currying
>associated with SUC a function
>of one variable returning a
>function of one variable is
>indistinguishable from a
>function of two variable
>(returning a normal value).
>And that is what the error
>message is
>showing.
__________________
�
>� � � Tom Gutman
So what I should have done is simply define the displacement function as displacement(x) as one would normally do and use the a range value for x. There was no need for the program.