Arc Forumnew | comments | leaders | submitlogin
5 points by bogomipz 5925 days ago | link | parent

If the [...] syntax had a notation for passing on all arguments, implicit currying would be less important. Being explicit about the currying has the advantage that you don't have to know the arity of a function to recognize that currying is taking place.

How about allowing (+ 3 7 4 6 3) to be written as:

  (let numbers '(4 6 3)
       (+ 3 7 . numbers))
Couple this with [...] capturing all arguments in a variable and you get something like this (feel free to come up with a better variable than ^):

  [foo 'a 'b 'c . ^]


2 points by eds 5923 days ago | link

Maybe with list splicing so you don't have to insert the list parameters at the end?

  (let numbers '(4 6 3)
    (+ 3 @numbers 7))

  [foo 'a 'b @^ 'c]
http://arclanguage.org/item?id=1920

-----

1 point by bogomipz 5922 days ago | link

Yes, by all means. Here, I was talking about currying, though, so splicing was not a concern.

I'm not quite sure whether @ should be allowed to reuse the list when used at the end, but I believe it would be most correct not to. So (like mentioned several times before) the dot notation means cons, while @ means splice, which is not the same thing, even when used at the end of the surrounding list.

-----