Arc Forumnew | comments | leaders | submitlogin
6 points by vsingh 6117 days ago | link | parent

This just made me notice something interesting.

This works:

    (eval (list 'oaf 1 2))
    2
But this does not:

    (eval (list oaf 1 2))
    Error: "Bad object in expression #3(tagged mac #<procedure>)"
In other words, you can't evaluate a form in which the car is the actual macro object itself, rather than the name of a macro. If we could make that work, we could solve your problem by inserting the macro objects we want where we want, in effect telling Arc which version of 'oaf' we want in advance.

It would make macro expansions pretty ugly to look at, though.



9 points by pg 6117 days ago | link

In other words, you can't evaluate a form in which the car is the actual macro object itself

The single biggest compromise I had to make because of MzScheme was not being able to put objects like functions and hashtables into macroexpansions. I don't know if I would have wanted to do what you tried to, but in other ways I'm constantly inconvenienced by this restriction.

You can do it in most CL implementations, though the spec is ambiguous on the matter.

-----

1 point by vincenz 6114 days ago | link

This was brought up before, namely here:

http://arclanguage.com/item?id=804

And there was a partial solution as well.

-----

2 points by akkartik 6117 days ago | link

This came up before: http://arclanguage.org/item?id=654

Why do you think it's ugly?

-----