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

It seems we can use macros in compose as long as the rightmost arg isn't a macro.

  arc> (def a(x) (+ 1 x))
  arc> (mac b(x) `(+ 1 ,x))

  arc> (map a:b '(1 2 3))
  Error: "Can't coerce  #(tagged mac #<procedure: b>) fn"
  arc> (map b:a '(1 2 3))
  (3 4 5)
  arc> (map a:b:a '(1 2 3))
  (4 5 6)
  arc> (map b:b:a '(1 2 3))
  (4 5 6)
Ah, it's because of the call to apply in the base case. And my function version called apply at each step.


1 point by rocketnia 2227 days ago | link

Whoops, I should have seen this coming when I commented at http://arclanguage.org/item?id=15172. ^_^;

-----