- Subject: Re: [slang-users] try does not run require
- From: Jörg Sommer <joerg@xxxxxxxxxxxx>
- Date: Sun, 11 Jun 2006 17:07:48 +0000 (UTC)
Hallo John,
"John E. Davis" <davis@xxxxxxxxxxxxx> wrote:
> Jörg Sommer <joerg@xxxxxxxxxxxx> wrote:
>>#v+
>>% cat /tmp/test.sl
>>try
>>{
>> require("stkcheck");
>> enable_stack_check();
>>}
>>catch OpenError: {} % stkcheck not in path
>
> This fails because slang makes no attempt to execute the code in the
> statement until the statement is complete. As a result,
> enable_stack_check is referenced before it has been defined.
Interessting. Really interesting. Everyday something new. I ever thought
SLang does a just in time resolving of the symbols.
Have you ever written a language specification for SLang? Something with
a grammar and a definition of the scope of variables? I can't construct
an example, but I have seen code like this that failed, because a
variable of the same name is defined.
#v+
do
{
variable foo = 2;
message("bla");
}
while (0);
variable foo = 3;
#v-
Jörg.
--
Objektivität ist die Wahnvorstellung, Beobachtungen könnten ohne
Beobachter gemacht werden - Heinz v. Foerster
_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html
[2006 date index]
[2006 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]