On Thu, Jan 17, 2019 at 04:29:17PM +0100, Danilo Kordic wrote:
>   IMHO (PicoLisp) Namespaces _are_ "name" prefixes, for example "pg~"
> instead of "pg-".
> 
>     [de pg []]  # Empty Namespace.
>     [de pg~sym ~...]

No, they are not.  "pg~" is not part of the name.


For example, one symbol may be in several namespaces. This is not possible with
name prefixes. Also, prefixes are part of the name and thus show up on string
operations like 'chop'.

With prefixes, you need to write them *always*, clobbering the source code.

Also, you can with namespaces dynamically control the search order for a given
name, which is not possible with prefixes. You may load the same source file in
different namespaces, giving different behavior.


>   Unfortunately Namespaces are not Association Lists, or Property Lists.

Why should they be? They would be too slow due to linear searches.


> Therefore they can not be processed by predefined procedures.  I must point
> out that Namespace interface is not exposed (as PicoLisp procedures), like
> "get" and so on for Property Lists!!

It is exposed. A namespace is an index tree, you can access it with 'all'.

☺/ A!ex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to