slang-users mailing list

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

Re: [slang-users] Bug in namespace allocation


Joerg Sommer <joerg@xxxxxxxxxxxx> wrote:
>$ cat /tmp/test.sl 
>% autoload("foo", "/tmp/test1.sl");
>autoload("_test->bar", "/tmp/test1.sl");
>
>% foo();
>_test->bar();
>$ cat /tmp/test1.sl 
>% try whether reevaluation works in SLANG 2
>implements("_test");
>message(current_namespace());
>
>public define foo()
>{
>    message("foo");
>}
>
>define bar()
>{
>    message("bar");
>}
>$ slsh /tmp/test.sl 
>Namespace _test already exists
>/tmp/test1.sl:2:<top-level>:Namespace Error
>#v-
>
>I've added a debug output to implements_ns() and saw that:
>ns->name = " *** internal ns <1> *** "
>name = "/tmp/test1.sl"
>
>in the error case. I think the allocation of the namespace by autoload()
>is the problem.

I am not convinced that it is a problem.  For example, try removing
the implements line from test1.sl.  You will find it works:

   $ slsh /tmp/test.sl
   _test
   bar

As I see it, the real problem is the use of `implements`, which I
regard as unnecessary for most purposes.  For example, by omitting the
implements line, test.sl can be changed to:

   autoload("foo->bar", "/tmp/test1.sl");
   foo->bar();

to produce the output:

   foo
   bar

The upshot is that I think that it is far better for the "loader" to
specify the namespace because only the "loader" can know what
namespaces already exist.

>BTW: Do you have a Bug Tracking System?

Yes and no.  No, I do not use any sort of automated bug tracking
software.  Yes, because when a bug report comes in, I make a note of the
problem and attempt to fix it.  It is also worth pointing out systems
like debian do track bugs on all of its "upstream" packages.  For
example, look at debian's bug tracking lists for slang1 and slang2:

  <http://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=slang1-dev>
  <http://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=libslang2-dev>

--John

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


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