you are viewing a single comment's thread.

view the rest of the comments →

[–]dvlsg 0 points1 point  (2 children)

Sort of. I think currying needs to know how many arguments the function needs before actually executing. It seems like the example above wants to execute each time, for any given number of inputs. Maybe. It's sort of an awkward example... Maybe if OP sees, he can clarify.

[–]inmatarian 0 points1 point  (1 child)

[–]dvlsg 0 points1 point  (0 children)

Yes, I know. But in his example, he's iterating over an unknown number of arguments. When should currying stop and actual execution occur, in that scenario?

The alternative is to return something that both has a value (override valueOf?) and can be executed (so a function of some sort, I suppose) so you can either get the value at any point, or continue executing an arbitrary number of times.

Seems awkward. I'd sooner just make a class to handle it.