Arc Forumnew | comments | leaders | submitlogin
7 points by almkglor 6128 days ago | link | parent

Incidentally, [...] syntax helps amortize the problem of non-existent curry: curried (map fn) == [map fn _]

Adding curry support will also require us to define flipped parameters, i.e.

  (def flip (f x y)
    (f y x))
Or better:

  (mac flip ( (f x . ys) )
    (if
      (no ys)
        (w/uniq p
          `(fn (,p) (,f ,p ,x)))
      (is 1 (len ys))
        `(,f ,(car ys) ,x)
        (ero "flip: more than two parameters in call")))
which allows us to use:

  (flip:map seq)


2 points by binx 6128 days ago | link

When parameters are too many, for example, in:

(def f (x) (fn (y) (g x y)))

According to currying, (f x y) should mean ((f x) y). This feature can't be expressed by [...] syntax.

-----

4 points by almkglor 6128 days ago | link

http://www.google.com/search?q=define%3Aamortize

I didn't say it completely eliminates the need for currying - I said it "amortizes" or PARTLY eliminates the need.

-----