tooli wrote:
> Hello,
> In order to graduate as a computer scientist I have to develop a macro
> pre-processor for Oz.
> The project is tutored by Peter Van Roy. Yves Jaradin, Raphael Collet and
> Kevin Glynn helped me on this task.
> I'm going to give the final code an report to Mr Van Roy very soon, which
> include a small english tutorial, explaining the syntax you can use to
> define macros in Oz, how they work, etc.
> I would like to present this tutorial to the Oz community as a preview of
> what could be integrated to the new Oz version. If you have comments (good
> or bad) to make, please send them to me. I really would like to know what
> the users think about this (especially the syntax, are the choices I made
> pleasant to you?).

I really like the way you've ensured hygiene -- very elegant.

I think the restriction on recursive macro uses having to use the same
arguments should be relaxed. Consider:

  pmacro alternately_while Cond do Expr1 then Expr2 end
      (| if Cond then Expr1 ( alternately_while Cond do Expr2 then Expr1 end )
         else skip end |)
  end

(The example is chosen for simplicity rather than usefulness.)
It can be expanded like this:

  alternately_while @A < 20 do ( A:[EMAIL PROTECTED] {Browse @A} then A:[EMAIL 
PROTECTED] {Browse @A} ) end
=>
  local Proc1 Proc2 in
      proc {Proc1}
          if @A < 20 then
              @A:[EMAIL PROTECTED] {Browse @A}
              {Proc2}
          else skip end
      end
      proc {Proc2}
          if @A < 20 then
              @A:[EMAIL PROTECTED] {Browse @A}
              {Proc1}
          else skip end
      end
      {Proc1}
  end

It seems as though an implementation that allowed this would be relatively
straightforward (remember which combinations of arguments have already
occurred so far in the expansion).

-- 
David Hopwood <[EMAIL PROTECTED]>



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

Reply via email to