4 ms·
I think it is all suggestions, not hard rules. Also, given that the quote allows you to use up to 1 argument, it is actually trivial to do (assuming you are fin
by gizmo686 13y ago
I think it is all suggestions, not hard rules. Also, given that the quote allows you to use up to 1 argument, it is actually trivial to do (assuming you are fine with the no side effects part). The trick is that instead of taking 2 parameters, you take 1 parameter, than generate and return a function that takes 1 parameter. Probably not what the author has in mind.
Anyway, in the context of the rest of the post, it looks like object oriented programming is being discussed, in which case I think the implicit 'self' does not count as a parameter.
- retrogradeorbit 13y agoOr just make the function take two arguments. And then use currying (if your language supports it). A lot of this depends on language. I definitely agree with you saying its suggestions, not hard rules. Unfortunately the author of the page keeps saying 'always' as if it's hard and fast rules. Understand why and when first, then use where appropriate.
- gizmo686 13y ago>Just make the function take two arguments. And then use currying. Isn't that what I said?