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

Ah, I didn't intend to actually change behavior. Feel free to revert http://github.com/nex3/arc/commit/cbf2bd3e08 (or I'll do it this evening -- and figure out what I'm missing).

edit: Done (http://github.com/nex3/arc/commit/f72acc2997). I'm still unclear on why the macro form is different, and why it works in some macro situations but not others (I've added two examples to that commit)



1 point by akkartik 4767 days ago | link

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 4767 days ago | link

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

-----