I am learning functional programming. A question came to my mind when I read about the lambda section introduction about FP.
In Scheme the syntax for anonymous functions is the following one:
(lambda (arg1...argn) body)
...
We can now easily define the compose function
(define (compose f g)
(lambda (x) (f (g x))))
I struggle to understand about x, it is not in the argument list of definition of compose function. so how is x passed in?
also, suppose we have function g1 taking argument y, z, how to call compose? compose (f1 g1) y z? If so, then it takes arguments not just two functions, but also the arguments from g1. I'm very confused.
xis argument of resulting composition. Suppose you have functionsf1andg1and argumentx1, then you can call it like that((compose f1 g1) x1).