[EMAIL PROTECTED]
On 15.03.2006, at 12:34, Torsten Anders wrote:
On 15.03.2006, at 11:43, Raphael Collet wrote:
Torsten Anders wrote:
Having full creator procedures for every syntactic construct which
can be expressed by a procedure would reduce the need for macros.
On the contrary: macros would simply define some syntactic construct
with new keywords. This would allow you to choose the right tradeoff
between syntactic constructs and constructor calls in your code.
IMHO making everything a function call makes the code less readable.
One of the particular dangers of macros is this: if you write an
abstraction for something for which you only have a macro requires the
abstraction again to be a macro, at least for more complex cases.
Just to be more specific:
Its great what we already can do, e.g.
fun {MakeClass MethodName#MethodBody}
class $
meth init skip end
meth !MethodName(...)=M
{MethodBody M}
end
end
end
C = {MakeClass myTest#proc {$ myTest(X Y)} Y=X*X end}
However, if I want to create a class in a function with multiple
methods, how can I do that when I only have the 'macro' class..end?
fun {MakeClass Methods}
%% e.g., Methods = [MethodName1#MethodBody1 ..]
class $
meth init skip end
<put method defs here>
end
end
Best,
Torsten
--
Torsten Anders
Sonic Arts Research Centre
Queen's University Belfast (UK)
www.torsten-anders.de
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users