Torsten Anders wrote:
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.
I agree, macros allow for syntactic sugar and that means less typing and
better readability.
On the other hand, if I have the choice to define either a
function/procedure or a macro, most often I prefer to write a function
(macros are no first-class values, the debugger does not see them...).
However, I may finally define some convenient macros for the very top
level which simply calls the function but reduces some typing.
For control structures, macros are often good enough. One essential
property of macros is that their expansion must be quite obvious. Maybe
recursive macros aren't that good, after all.
But for abstractions, I second you. A first-class definition gives a
precise semantics, and usually enforces encapsulation. Macros only
provide syntactic sugar.
Regards,
raph
_________________________________________________________________________________
mozart-users mailing list
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users