Arc Forumnew | comments | leaders | submitlogin
2 points by d0m 5326 days ago | link | parent

Thanks for answer. You are right, my example doesn't work :p However, I still think that currying is important as it simplifies nested code a lot.

Maybe:

(map {+ 10} '(1 2 3))

Or maybe, it should just be a convention in arc that when not enough parameters are given, a currying function is returned. So we could do:

(map (+ 10) '(1 2 3))

even if I know it may break a lot of things :p

-----

Also, I feel that, from a good coding perspective, x is great as a temporary variable in []. In fact, it might be a good thing that the programmer is forced to use a good variable name instead of x for normal arguments.

To take your example:

(def testify (x) (if (isa x 'fn) x [is _ x]))

(def testify (type) (if (isa type 'fn) type [is x type]))