[plt-scheme] Understanding lambda
Neil Van Dyke wrote:
> aditya shukla wrote at 02/13/2009 03:05 PM:
>> I am trying to understand lambda and i have a question.
>
> Remember you have DrScheme, and can experiment:
>
> Welcome to DrScheme, version 4.1.4 [3m].
> Language: Module; memory limit: 128 megabytes.
> > (define f (lambda(x) (+(* 3 x) 5)))
> > f
> #<procedure:f>
> > (f 2)
> 11
> >
Let me second Neil's recommendation to experiment. Make some examples
and try to predict how they are computed. For more fine grained
experiments, I suggest using the Intermediate Student with lambda
language; you can use the Stepper to see each step of the computation.
Try to predict which piece of the program will step, and how it will
step. If you can do this consistently and fluently, you understand.
David