Explanation of macros; Haskell macros
Joachim Durchholz
joachim.durchholz at web.de
Wed Oct 29 20:18:53 EST 2003
Alain Picard wrote:
> "Robert Klemme" <bob.news at gmx.net> writes:
>
>>Just for the sake of my understanding: could one summarize this as "macros
>>make control of *when* something is evaluated easier"?
>
> More precisely: "macros make control of when, if, and how often,
> something is evaluated _possible_."
>
> Functions (your only other option) give you no choice.
This statement is wrong if left in full generality: higher-order
functions can control quite precisely what gets evaluated when. If the
language offers both lazy and strict parameters, evaluation time control
extends to the parameter expressions as well.
It's a different kind of control than macros, of course. (It would be
interesting to see how things would map from macros to functions and
vice versa.)
Regards,
Jo
More information about the Python-list
mailing list