- Subject: Re: [slang-users] wrong predeclaration makes function unaccessable
- From: Jörg Sommer <joerg@xxxxxxxxxxxx>
- Date: Tue, 9 Jan 2007 22:50:46 +0000 (UTC)
Hallo John,
"John E. Davis" <davis@xxxxxxxxxxxxx> wrote:
> =?UTF-8?Q?J=C3=B6rg?= Sommer <joerg@xxxxxxxxxxxx> wrote:
>>
>>#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.
When you say the static function has an empty body this should be
equivalent to the definition above:
static define foo() {}
But this gives an error. I think, SLang should complain about the
previous definition of foo() with a different modifier as it does if the
functions have bodies.
Bye, Jörg.
--
Der Mensch hat die Atombombe erfunden.
Keine Maus der Welt käme auf die Idee, eine Mausefalle zu konstruieren.
_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html
[2007 date index]
[2007 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]