Arc Forumnew | comments | leaders | submitlogin
4 points by rincewind 5936 days ago | link | parent

Avoiding re-inventing rreduce:

  (def >> args
     (rreduce (fn (a b) a.b) rev.args))


3 points by almkglor 5936 days ago | link

Avoiding rev:

  (def >> args
    ; throw an error here so that user won't get
    ; mysterious errors in the 'reduce part
    (if (no args)
      (err "'>> requires at least one argument"))
    (reduce (fn (a b) b.a) args))

-----