I use lectures and SICP text to learn about Scheme myself. I am reviewing an exercise that says: “Using E is an expression of the form (E E1, ... En). This includes the case n = 0 corresponding to (E). E is either an application of E or an application of Curried E. "
(Edit: I corrected the above quote ... I initially misinterpreted the definition.)
The challenge is to define a Curried application that evaluates a value of 3 for
(define foo1
(lambda (x)
(* x x)))
I really don't understand this idea here, and reading the Wikipedia article about Curriying really didn't help.
Can someone help with a clearer explanation of what is being asked here?
In fact, even giving me an answer to this problem would be useful, because after that you still need to solve five .... I just do not understand the main idea.
Addition: Even after Brian Campbell's long explanation, I still lost a few.
Is (foo1 (sqrt 3)))the application foo reviewed, and therefore the curry application foo?
It seems too simple, but maybe ...
Entering (((foo1 2 )) 2)into DrScheme gives the following error (which I expect)
procedure application: expected procedure, given: 4 (no arguments)
After reading again What is Currying? I understand that I can also override foo1 as follows:
(define (foo1 a)
(lambda (b)
(* a b)))
So i can print
((foo1 3 ) 4)
12
But that doesn't make me closer to creating 3 as output, and it doesn't seem like the original foo1 looks like it, it just overrides it.
Damn, 20 years of programming C did not prepare me for this. :-) :-)