[slang-users] autoload loads two times
Jörg Sommer
joerg at alea.gnuu.de
Tue Jul 25 17:46:59 EDT 2006
Jörg Sommer <joerg at alea.gnuu.de> 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)
More information about the slang-users-l
mailing list