213 reputation
16
bio website twitter.com/jordangray
location England, United Kingdom
age 30
visits member for 1 year, 11 months
seen Apr 6 at 23:44

I'm a web developer currently living in Lancaster. I like code, maths, reading and cooking.

Find out more about me on Twitter and LinkedIn.


Jul
30
revised Are missed deadlines common in programming jobs?
Spelling, grammar, formatting.
Jul
30
suggested suggested edit on Are missed deadlines common in programming jobs?
May
23
awarded  Yearling
Apr
4
comment Does groovy call partial application 'currying'?
@VorgvanGeir I approve of language designers making pragmatic decisions in accordance with the principle of least surprise. In this particular case, there's a conflict between expected semantics and inter-version consistency: the current name is awkward to everyone who knows what currying and partial application are, but changing the names now will annoy people familiar with the existing implementation. I think my suggestion above is a decent trade-off, but it depends how you prioritise those concerns.
Apr
3
awarded  Nice Answer
Mar
7
revised Does groovy call partial application 'currying'?
Made links more obvious, removed reference to Resig, added explanation of my solution back when this was first discussed.
Feb
26
awarded  Caucus
Nov
19
awarded  Autobiographer
Jun
14
comment Does groovy call partial application 'currying'?
@matcauthon Strictly speaking, the "purpose" of currying is to transform a function with many arguments into a nested chain of functions with one argument each. I think what you're asking for is a practical reason you'd want to use currying, which is a bit tougher to justify in Groovy than in e.g. LISP or Haskell. The point is, what you probably want to use most of the time is partial application, not currying.
Jun
14
comment Does groovy call partial application 'currying'?
"What's the purpose" is a big question to answer in a little comment. Much harder than "what's the difference," which hopefully you now understand. (If you do, well done: you know more than a lot of the smartest JS ninjas out there.)
Jun
14
comment Does groovy call partial application 'currying'?
It's very significant, trust me. Again, the code at the end of my answer demonstrates how a correct implementation would work; it would take no arguments, for one thing. The current implementation should really be named e.g. partial.
Jun
14
comment Does groovy call partial application 'currying'?
@jk In fact, it is demonstrable on functions with arguments == 2, as I note at the end. :)
Jun
14
comment Does groovy call partial application 'currying'?
@jk is correct. Read the Wikipedia explanation again and you will see that what gets returned is a chain of functions with one argument each, not one function with n - 1 arguments. See the example at the end of my answer; also see later in the article for more on the distinction being made. en.wikipedia.org/wiki/…
Jun
14
awarded  Editor
Jun
14
revised Does groovy call partial application 'currying'?
Minor wording.
Jun
14
awarded  Teacher
Jun
14
comment Does groovy call partial application 'currying'?
IBM's definition is incorrect. What they define as currying is actually partial function application, which binds (fixes) arguments of a function to make a function with smaller arity. Currying transforms a function that takes multiple arguments into a chain of functions that each take one argument.
Jun
14
answered Does groovy call partial application 'currying'?
May
23
awarded  Supporter