Timeline for Is this an acceptable way to shave a byte in ES6?
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 15, 2016 at 7:50 | comment | added | Martin Ender Mod | As nimi noted in a comment on the question, this would actually disallow function submissions in languages like Haskell for any problem that takes multiple arguments, since any multi-argument function is actually a curried single-argument function there. | |
Feb 15, 2016 at 3:21 | comment | added | Alex A. Mod |
I think calling it like f(a)(b) is reasonable so long as its stated that it should be called that way.
|
|
Feb 15, 2016 at 3:20 | comment | added | user81655 |
@AlexA. No, it would return the sum when called like f(a)(b) , but note that you are actually calling the outer and the inner function which seemed like processing outside of the solution to me. If your answer is the outer function, I feel like you should only be allowed to call the outer function.
|
|
Feb 15, 2016 at 3:16 | comment | added | Mama Fun Roll |
I disagree. If you know lambda calculus, you know that \xy.xy is the same as \x.\y.xy . (If you don't: basically, chaining functions as a=>b=> is the same as (a,b)=> ).
|
|
Feb 15, 2016 at 3:08 | comment | added | Conor O'Brien | I disagree. You imply that there is a strict way of calling a javascript function; when the code is used in that way, then of course you'll end up with a function. | |
Feb 15, 2016 at 3:08 | comment | added | Alex A. Mod |
Does it return a function if you call it like f(a)(b) ?
|
|
Feb 15, 2016 at 3:02 | history | answered | user81655 | CC BY-SA 3.0 |