slang-users mailing list

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

[slang-users] Re: slang2 pre-release snapshot 4 available


"John E. Davis" <davis@xxxxxxxxxxxxx> wrote:
> Changes since 2.0.0 pre-release 3
> 13. src/slang.c: The autoload function may be used to load a file into
>     a namespace. (Based upon an idea from Jörg Sommer (joerg at alea,
>     gnuu, de)

I'm getting an error if I have an implements statement in the file loaded
via autoload.

somewhere:
autoload("foo->bar", "foo.sl");

foo->bar();

foo.sl:
implements("foo");

define bar() { message("bar called"); }

$ xjed-2.0 -batch -l /tmp/somewhere.sl 
[...]
loading /tmp/somewhere.sl
Namespace "foo" already exists
/tmp/foo.sl:1: Run-Time Error
/tmp/somewhere.sl:3: Run-Time Error
Error encountered while executing command_line_hook
Run-Time Error

BTW: John, did implement the possibility to mark a whole namespace for
  autoload? I don't find how to do that?

BTW2: Where should appear the implements()? I place it as the first
  statement in a file like package in java or namespace in C++. But if
  loading the file fails, because of a syntax error, I can't reload this
  file, because the namespace exists.

Jörg.

-- 
Der Klügere gibt so lange nach bis er der Dumme ist.

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


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