Re: Namespace support

2011-10-18 Thread Tomas Hlavaty
Hi Alex, Also, as we discussed on IRC, it would be nice to have the namespace name displayed in the repl prompt, e.g. via customizable prompt function as you suggested. I would suggest a new global variable '*Prompt', which may hold an 'exe', so that (setq *Prompt '(symbols)) will

Re: Namespace support

2011-10-14 Thread Tomas Hlavaty
Hi Alex, Also, as we discussed on IRC, it would be nice to have the namespace name displayed in the repl prompt, e.g. via customizable prompt function as you suggested. I would suggest a new global variable '*Prompt', which may hold an 'exe', so that (setq *Prompt '(symbols)) will

Re: Namespace support

2011-10-11 Thread Tomas Hlavaty
Hi Alex, (setq x st1) (setq x~sym1 5) (print sym1 x~sym1 st1~sym1) # = NIL 5 5 great, it does what I was after! How can I create a new empty symbol table? This is easy. Just initialize it with an empty cons pair: (setq st1 (cons)) However, I just didn't want to support

Re: Namespace support

2011-10-11 Thread Alexander Burger
Hi Tomas, Also, as we discussed on IRC, it would be nice to have the namespace name displayed in the repl prompt, e.g. via customizable prompt function as you suggested. Oops, right. Forgot about that. I would suggest a new global variable '*Prompt', which may hold an 'exe', so that

Re: Namespace support

2011-10-11 Thread Alexander Burger
On Tue, Oct 11, 2011 at 12:08:10PM +0200, Alexander Burger wrote: I would suggest a new global variable '*Prompt', which may hold an 'exe', so that (setq *Prompt '(symbols)) will result in a prompts pico: The ':' is supplied automatically, and - as before - changes to '!' in

Re: Namespace support

2011-09-29 Thread Alexander Burger
Hi all, please note that I released a slight modification of the namespace support: The 'load' function will preserve the current namespace, even if it is changed by 'symbols' while loading a file. The reasons can be seen best in the example from the previous discussion with Tomas:

Re: Namespace support

2011-09-21 Thread Alexander Burger
On Mon, Sep 19, 2011 at 07:56:42PM +0200, Tomas Hlavaty wrote: 2. importing a symbol from another namespace (with 'intern') Renaming a symbol is not interesting. Importing maybe is, to a certain point. Now I added an 'import' function, a simple frontend to 'intern'. With that, we can

Re: Namespace support

2011-09-20 Thread Henrik Sarvell
It solves the long function name problem and due to class naming conventions it improves the global namespace problem quite a bit. The long function name solution solves the the global namespace problem completely but is imo not a good solution as it can easily become absurd. On Tue, Sep 20,

Re: Namespace support

2011-09-19 Thread Alexander Burger
Hi Tomas, Personally I am not a fan of namespaces in picolisp. Yes. As you know, I am neither. However, the current implementation won't do any harm, as long as it is not actually used (and I won't probably use it ;-) It is a simple extension of the general principles underlying PicoLisp

Re: Namespace support

2011-09-19 Thread Henrik Sarvell
Importing symbol from another namespace can be done with (intern 'myNames~Foo) - Foo This will make the symbol 'Foo' from 'myNames' available as an internal symbol in the current namespace. This is imo a must have feature, it has to be up to the programmer to avoid clashes as it is

Re: Namespace support

2011-09-19 Thread Jakob Eriksson
On Mon, Sep 19, 2011 at 02:51:32PM +0700, Henrik Sarvell wrote: Having to write the full name all the time could easily become comical, as in my above Clojure example. This is also one of the reasons I have leaned towards +1 Imagine all the rants which could be made about code full of both

Re: Namespace support

2011-09-19 Thread Thorsten
Jakob Eriksson ja...@vmlinux.org writes: On Mon, Sep 19, 2011 at 02:51:32PM +0700, Henrik Sarvell wrote: Having to write the full name all the time could easily become comical, as in my above Clojure example. This is also one of the reasons I have leaned towards +1 Imagine all the rants

Re: Namespace support

2011-09-19 Thread Thorsten
Henrik Sarvell hsarv...@gmail.com writes: I can understand both your arguments Thorsten but in the end there must've been a reason why you found PicoLisp interesting enough that you wanted to try it out as opposed to using elisp/common lisp for everything. Perhaps it was the brevity and

Re: Namespace support

2011-09-19 Thread Tomas Hlavaty
(func '+Kadabra arg1 arg2) is shorter than: (foo.bar.blabla.abra.kadabra.func arg1 arg2) no, it's similar to (Kadabra.func arg1 arg2). (func '+Foo.bar.blabla.abra.kadabra arg1 arg2) is similar to (foo.bar.blabla.abra.kadabra.func arg1 arg2). Cheers, Tomas -- UNSUBSCRIBE:

Re: Namespace support

2011-09-18 Thread Tomas Hlavaty
Hi Alex, for namespaces convenient. Scheme implementations provide an import statement that let's you include symbols from one namespace into your current one. This is not yet exciting but you can manipulate the symbols during this import: - prefixing them - renaming them - filtering out

Re: Namespace support

2011-09-16 Thread Alexander Burger
Hi Christian, for namespaces convenient. Scheme implementations provide an import statement that let's you include symbols from one namespace into your current one. This is not yet exciting but you can manipulate the symbols during this import: - prefixing them - renaming them -

Re: Namespace support

2011-09-16 Thread Alexander Burger
Hi Henrik, As far as I can tell this makes the (context) thing you implemented before pretty redundant or is it worth keeping? Yes, I would say we forget about that one. It was a completely different concepts. It didn't implement symbol namespaces (all symbols were still in the single global