سؤال

How do you define a curried function with the function keyword in Livescript?

More succinctly, how can I get this

function curry (arg1, arg2)
  do-something arg1, arg2

To act like this

curry = (arg1, arg2) -->
  do-something arg1, arg2
هل كانت مفيدة؟

المحلول

You can't, and the way curried functions are created in LiveScript currently, it would not be possible to.

Curried functions are created using the curry$ helper function. We can't call this helper function on a function declaration, because it is a declaration not an expression.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top