Today I noticed something, I think for the first time.
When used inside Compile
variable values within Module
(and Block
) are sequentially shared:
Compile[nCompile[{}, Module[{a = 7, b = a}, b + 1]] @1] 1][]
8
Compare the behavior outside of Compile
:
Module[{a = 7, b = a}, b + 1]
1 + a
Is this documented behavior or just a happy accident?
CanIf undocumented can it be relied upon or should this "trick" be avoided?