Arc Forumnew | comments | leaders | submitlogin
6 points by drcode 5925 days ago | link | parent

According to your essays, a major paradigm of arc is to let hackers do as much as possible, without giving errors when the compiler is worried things are "too dangerous". Partial application/function currying is my #1 request for arc right now... I would love it if any arc function given too few non-optional parameters would perform an implicit curry.


7 points by almkglor 5924 days ago | link

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 5924 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 5924 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.

-----