[plt-scheme] Understanding lambda
On Fri, Feb 13, 2009 at 3:32 PM, aditya shukla
<adityashukla1983 at gmail.com> wrote:
> Thanks for the help guys , so now i know that in (define f (lambda(x) (+(*
> 3 x) 5))) value of f is a function returned by the lambda expressions.
What is f?
f is a function with one parameter called x.
> so
> when i do ( f 1) or anything as in (f 55) then what are 1 or 55 in this
> expression , constants or functions?
>
1 and 55 are the values of x for the two different applications of f
to an argument (i.e. (f 1) and (f 55)). When you apply f to 1 (i.e. (f
1) ), x takes the value of 1. When you apply f to 5 (i.e. (f 55) ), x
takes the value of 55.
Forget Scheme syntax for a second.
f(x) = 3x + 5
Consider f(1) and f(55).
I hope that clears it up.
--
Cheers,
Marco