jed-users mailing list

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

Re: Namespaces for modes?


Günter Milde <milde@xxxxxxxxxxxxxxxxxxxx> wrote:
>    browsing for existing functions. There should be something like 
>    list_namespaces().)

The _get_namespaces function was added in 1.4.7.  Someone asked why
jed does not make use of namespaces.  The reason is that namespace
support is relatively new in slang and is still evolving.  For
example, I am toying with the idea of adding namespace objects to
slang 2.  For example, suppose ns represents a namespace that contains
functions set and get, e.g.,
    
    implements ("ns");
    private variable v;
    static define get () { return v; }
    static define set (x) { v = x; }

Currently slang 1 permits code such as

    ns->set (10);
    if (ns->get () == 10) ...

However, slang 2 _may_ allow instances of a namespace, e.g.,

    x = @ns;
    y = @ns;
    
    x->set (10);
    y->set (20);
    
where now x and y represent separate instances of the namespace.
Perhaps you can see where I am going with this.

>> autoload("latex->", "latex.sl");
>
>This would indeed be a nice thing to have (however, I fear it is not
>easily done)!

Yep-- I have not thought of a good implementation for this.

Thanks,
--John


--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


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