Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it safe to nest macro invocations?

I have been testing some nested macro invocations, and they worked as expected (...as expected by me!) For instance, supposing a ficticious add macro and the following expression:

add(1, add(2, 3))

Firstly the inner add is expanded (2 + 3) and secondly the outter one does its part (1 + (2 + 3)). I have seen that the outter macro does not receive any noise from the internal invocation -in the input expression- so the inner expansion seems totally transparent to it. Does this fact always hold (even with more complex macros and types)? Is it safe to do so?

like image 817
jeslg Avatar asked Jul 03 '12 14:07

jeslg


1 Answers

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

like image 73
Eugene Burmako Avatar answered Sep 23 '22 12:09

Eugene Burmako