Is it safe to install macros?

I tested several nested macros and they worked as expected (... as expected by me!) For example, assuming a dummy add macro and the following expression:

add(1, add(2, 3))

Firstly, the internal addition expands (2 + 3), and secondly, the upper part fulfills its part (1 + (2 + 3)). I saw that the outter macro does not receive any noise from the internal call - in the input expression, so the internal extension seems completely transparent to it. Does this fact persist (even with more complex macros and types)? Is it safe to do this?

+5
source share
1 answer

Internal macros are always expanded first (even if they are represented as by-name arguments).

+8
source

All Articles