procedure p(l,m,n,x,y,z)
equivalent of the p(x:=a; z:=b) seems to be expression
(every (l|m|n|x|y|z):=&null) & x:=a & z:=b & p(l,m,n,x,y,z).
The first and the last of the conjuncts are fixed, used always in the same form, so even limited Unicon macros allow further simplification. One of the possibilities is
P(x:=a & z:=b)Pend .
Hence, those who like (or tolerate) macros can manage CBPN for themselves, perhaps not in the prettiest possible form, however, it is possible.
How would this work for recursion, where the variable names are the same, but you only want to be modifying the local instance? Take something like:
procedure F(..., x, ...)
...
F(..., x := x+1, ...)
...
endIf it were macro based, there would be severe restrictions on naming conventions, as what you name a parameter in one function may affect your ability to call it or be called from another function. This violates locality, making it very difficult to manage.
Now, there are ways around this as well; basically, have the macro change each parameter name to a name with the function name encoded in it. In the easy way to get it right, you would need to do that at the point of function declaration, not at the point of function invocation, which would add overhead to each and every function that takes parameters. A macro expansion of the top might be:
procedure F(..., _F_x, ...)
x := _F_x
...
F(..., x+1, ...)
...
endAlternatively, if you want to do it at the point of function invocation to make only the people who use call by name pay for it, you have to take into account calls like:
F(..., x := F(x := x + 1), ...)
and have the macro come up with multiple unique local variable names (say, by appending it with an increasing number).
However, this does point out a problem with the syntax. Is
F(..., x := x + 1, ...)
invoking call by name on the parameter x, or is it incrementing x by 1 and passing that in positionally to F?
--
Nevin ":-)" Liber <mailto:[EMAIL PROTECTED]> (773) 961-1620
------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Unicon-group mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/unicon-group
