Arc Forumnew | comments | leaders | submitlogin
1 point by rocketnia 5294 days ago | link | parent

Well, here's something:

  (mac foo (x) (prn "expanding") `',x)
  (def bar () (~~foo:idfn 2))
  (def baz () (~~foo:and 2))
Calling 'bar or 'baz shouldn't print "expanding", and defining them should. I'm using 'idfn and 'and to show that it doesn't matter if that part is a function or a macro. In fact, if it's (~~foo:foo 2), the second 'foo is expanded during compilation time but the first one isn't, and it should really be the other way around. (This shouldn't be treated as a second bug; I figure it's just a consequence of compiling the arguments to the outer 'foo, whose macroexpansion has been skipped somehow.)

There's a workaround: Use "no:" instead of "~":

  (mac foo (x) (prn "expanding") `',x)
  (def bar () (no:no:foo:idfn 2))
  (def baz () (no:no:foo:and 2))
Oddly (but nicely), this works just fine.