Hacker News new | ask | show | jobs
by Retra 4105 days ago
Why call them 'arguments' when nobody is arguing?

Currying is the name of the thing. Adding another Enterprise Edition Operational Process Development Pattern like "argument deferral" isn't any better. I mean "Dependency Injection" isn't any easier for beginners to grasp, even though that is what it is.

Besides, it isn't argument deferral. That could easily be confused with evaluation order or things like lazy/normal/strict evaluation.

2 comments

+1 for "Enterprise Edition Operational Process Development Pattern"
From the perspective of a non-functional language, it is argument deferral because you're composing your sequence of functions first, which can then be used by later adding inputs for evaluation.

Were you thinking of partial application (not the same as currying)? I would agree that this is not argument deferral, rather it's more like argument presetting.

No, I was thinking about what I said: evaluation order and evaluation method.

For instance, if I had a function like

    func(a,b)
with the semantics that a would be evaluated before b, it would be perfectly reasonable to allow someone to evaluate argument b first instead. Thus 'argument deferral': you defer the evaluation of a until after b.

The second case is about when the arguments are evaluated: do you evaluate them when the function is called, or do you defer evaluation until when they are used? This is obviously 'argument deferral' as well, but we usually call it lazy evaluation.

http://en.wikipedia.org/wiki/Evaluation_strategy

The term 'Argument deferral' could apply perfectly well to a discussion of Evaluation Strategy, even though that has little to do with currying.

"Argument deferral" of the type you describe (like partial application, for that matter) is something currying can be used to achieve, but is not what currying is.

So, even if it was proposed when "currying" wasn't well established as the name for currying, it wouldn't be a particularly good choice.

I agree, I've revisited my position. Argument deferral and partial application (my term: argument presetting) is something that currying can achieve, but it's not what currying is.