slang-users mailing list

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

Re: [slang-users] autoload loads two times


Jörg Sommer <joerg@xxxxxxxxxxxx> wrote:
> Hi,
>
> can someone explain why the stkcheck file is loaded two times?

My example was wrong.

#v+
% head /tmp/bug*
==> /tmp/bug.sl <==
implements("bug");
autoload("enable_stack_check", "stkcheck");
try
{
    enable_stack_check();
}
catch OpenError: {}

() = evalfile("/tmp/bug2.sl");
==> /tmp/bug2.sl <==
autoload("enable_stack_check", "stkcheck");
try
{
    enable_stack_check();
}
catch OpenError: {}
==> /tmp/bug3.sl <==
implements("bug");
autoload("Global->enable_stack_check", "stkcheck");
try
{
    enable_stack_check();
}
catch OpenError: {}

() = evalfile("/tmp/bug2.sl");
#v-

In bug3.sl the "Global->" was added to bug.sl.

#v+
% xjed -batch -l /tmp/bug.sl | tail -n5
loading /usr/share/jed/lib/compress.slc
loading /tmp/bug.sl
loading /usr/share/slsh/stkcheck.sl
loading /tmp/bug2.sl
loading /usr/share/slsh/stkcheck.sl
% xjed -batch -l /tmp/bug3.sl | tail -n5
loading /usr/share/jed/lib/modeinfo.slc
loading /usr/share/jed/lib/compress.slc
loading /tmp/bug3.sl
loading /usr/share/slsh/stkcheck.sl
loading /tmp/bug2.sl
#v-

If I put the autoload() before the implements in bug.sl stkcheck.sl is
not loaded twice. If I use evalfile() in bug.sl instead of autoload(),
stkcheck.sl is also loaded only one time. I think this is a bug. autoload
should behave like evalfile() in this case.

Regards, Jörg.
-- 
Ein Mensch sieht ein und das ist wichtig,
nichts ist ganz flach und nichts ganz richtig.
                                               (Eugen Roth)

_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html


[2006 date index] [2006 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]