3 ms·
Partial application isn't in conflict with closure. Partial application doesn't really compensate for an identifier reference not being able to reach its appar
by kazinator 10y ago
Partial application isn't in conflict with closure.
Partial application doesn't really compensate for an identifier reference not being able to reach its apparent definition across a lambda boundary.
To an extent it does. Yes, story: "I'd like to pass Z as an argument here. Oops, Z is an outer variable outside the current lambda, so not reachable. But, aha, this is the last argument of the call I'm making, so just omit it. A function will then evaluate out of here and emerge as a value in the outer scope where Z is visible. There we can apply Z to that function and presto: effectively, we got Z as the last argument."
I get it, but it's a very limited workaround scenario. What if Z isn't the last argument; what if it is two scopes removed instead of just one, and so on.
Pretty much most functional languages that have partial application sugar are also lexically scoped, aren't they?
(You know, even Niklaus Wirth's Pascal has local functions that can see the local variables in their parent functions! When those functions are used as functional arguments, they can go downward only ("downward funargs"). So they aren't first class closures.)
- martyalain 10y agoI learned a lot with you. Thanks.