|
|
Wasn't it Slime who wrote:
>
>I don't quite follow you, but since you seem to understand the problem, do
>you think there is any sort of workaround (aside from never relying on
>passing variables by reference)?
You could load the variables with values that the macro is unlikely to
return, perform tests after the macro call to see if they're unchanged
and call the macro again. Because the problem occurs at widely separated
intervals, a second call will succeed. You need to think about whether
the macro has any side effects which shouldn't be duplicated.
E.g. in the original Tsutomo Higo scene we could write:
#declare M = 0; #while (M<3)
#declare Cp[T][L][M] = 12345;
#declare M = M+1; #end
Wave (Cp[T][L][0], Cp[T][L][1], Cp[T][L][2], T+Ncase, L)
#if (Cp[T][L][0] = 12345 | Cp[T][L][1] = 12345 | Cp[T][L][2] = 12345)
Wave (Cp[T][L][0], Cp[T][L][1], Cp[T][L][2], T+Ncase, L)
#end
The Wave() macro doesn't have any side effects and can't ever validly
return the value 12345, so if one of the outputs is still 12345 we call
the macro again.
--
Mike Williams
Gentleman of Leisure
Post a reply to this message
|
|