Arc Forumnew | comments | leaders | submitlogin
1 point by akkartik 3849 days ago | link | parent

Yeah, if I had to choose one axis over the other I'd rather have multiple functions than multiple arguments.

Here's the current varargs version of -> in wart:

  mac (transform x ... fs|thru)
    if no.fs
      x
      `(transform (,x -> ,car.fs) ,@cdr.fs)
Now you can call it like this:

  (transform 3 :thru (fn(_) (_ * 2))
                     (fn(_) (_ + 1)))
I think I'd support multiple args by using :thru as a delimiter:

  (transform 1 2 :thru (fn(a b) (a * b))
                       (fn(_) (_ + 1)))
But really, there's no need:

  (transform 1*2 :thru (fn(_) (_ + 1)))