Torsten Anders wrote:
On 15.03.2006, at 09:08, Raphael Collet wrote:
We want to be able to extend Oz with something that still looks like
Oz. We want something like
unless X<Y do {Show X} {Show Y} end
I just try to understand what a macro facility like this implies. I
understood that this was not officially announced yet. I am just curious..
In the Lisp community, there was complain that macro calls can not be
distinguished from function calls. Your Oz-macro facility does not even
mark the call explicit -- in contrast to
{F X} or <<f X>>.
The macro is just a rewrite rule on the source code. There is no call
in the example. It expands to
if X<Y then skip else {Show X} {Show Y} end
Would this syntax turn every atom potentially in a keyword (i.e. the
start of a macro call)?
Yes.
Would all macros be global, or are they explicitly imported? Say, I am
using some Oz extension from Mogul which defines some macros I am not
aware of.I may happen to use the name of this macro just as a datum.
IMO macros must be explicitly imported. A macro defined in a oz file
should be valid for that file only. Macros themselves should be put in
their own files (let's say Loops.ozm), and imported in the oz file that
you want to compile. In other words, macros are not part of a compiled
module.
Regards,
raph
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users