-----BEGIN PGP SIGNED MESSAGE-----
Le 25/06/2015 02:26, clipka a écrit :
> Some fun(?) fact to know:
> If, in an include file or macro, you use #declare with an
> identifier that already happens to exist at a non-global scope, you
> will NOT change the corresponding global variable, but the most
> local variable of that name.
> Expected that? I didn't.
I did, but I know how the context are stacked...
My hint: do not mix #declare and #local for the same variable, or even
parameter name of macro.
The same kind of problem happens with other languages, it's called
shadowing and it's a mess to know which one is used.
The long way would be to issue warning when using #local on a
#declare/d variable, and vice-versa, but it might requires extending
each storage to store that piece of data ( there is also #for... the
variable is kind of #local, yet should it be allowed to be updated
with #local ? )
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
-----END PGP SIGNATURE-----
Post a reply to this message