slang-users mailing list

[2006 Date Index] [2006 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [slang-users] try does not run require


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]