Torsten Anders wrote:
On the other hand, I actually very much like the idea of saving the amounts of typing. But if it requires to extend the core of Oz itself, then I would opt for the big change, i.e. for introducing something like Lisp macros instead. With such a means, everyone of us can then easily tailor the Oz syntax according needs.

Yes, I know that Denys gave that a go and it was turned down in the end. I also know that macros are a two edged sword: no first-class values, makes debugging harder etc.

Nevertheless, what Denys did is still there (http://www.mozart-oz.org/documentation/macro/node1.html) and even still works in 1.3.1. Something like this would really save me tremendous amounts of typing at times. I am not using it, though, because I expect this functionality be broken at any time.

Wouldn't it be worth discussing macros for Oz again?

It is not public, but at UCL we are thinking about it. But we are not satisfied at all with what Denys proposed. 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

instead of

   <<unless X<Y {Show X} {Show Y}>>

We have a student who is currently working at macros that allows to define something like the first alternative. He even consider macros with a recursive definition! This is extremely elegant for defining loops. He defines a while loop more or less as

MACRO while Cond do Body end
   if Cond then
      Body  while Cond do Body end
   end

You don't need to know how to manipulate the syntax tree of your program with such a definition. This part is done for you.

Cheers,
raph

_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to