[slang-users] wrong predeclaration makes function unaccessable

John E. Davis davis at space.mit.edu
Mon Jan 8 06:54:32 EST 2007


=?UTF-8?Q?J=C3=B6rg?= Sommer <joerg at alea.gnuu.de> wrote:
>is this an expected behaviour?

Yes.

>
>#v+
>implements("gaga");
>
>static define foo();			% wrong behaviour
>% private define foo();			% correct behaviour
>
>static define bla()
>{
>    foo();
>}

When "bla" gets compiled, the only version of "foo" that is available
is the one that exists in the static namespace.  Hence it is the one
that gets linked to "bla".  And because the body of the function does
not exist, the function will do nothing when called.

--John




More information about the slang-users-l mailing list