Re: (pack (intern NIL)) bug?

2009-04-22 Thread Alexander Burger
On Wed, Apr 22, 2009 at 10:07:54AM +0100, Tomas Hlavaty wrote:
 Are there other special symbols in the 32bit PicoLisp that behave
 like NIL?

Not that I can think of any. Except for the mentioned example where
symbols look like numbers.

Cheers,
- Alex
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


Re: (pack (intern NIL)) bug?

2009-04-22 Thread Tomas Hlavaty
Hi Alex,

 The question is: What is the correct way?

I am writing my own sexp reader which is safe against malicious input,
i.e. it does not call eval (the escape chars like ` are not
understood).

: (intern 123)
- 123
: (+ @ 7)   
123 -- Number expected

I thought I could use (intern (till  ^I^M^J()\ T)) to read in atoms
but obviously it's not possible because intern does not understand
numbers.  'any' seems to be using the picolisp reader so I cannot use
that:

: (intern 12`+453)
- 12\`+453
: (any 12`+453)
- 12

is not the same.

Looks I need to make more effort and determine the type of the atom
before feeding it to 'intern' or 'format'.

 In general, 'intern' should do what it is supposed to do, and intern
 a symbol. When the user chooses to intern a symbol with a strange
 name like 123 it is his choice.

I suppose that's reasonable.

Thank you,

Tomas
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe


(pack (intern NIL)) bug?

2009-04-21 Thread Tomas Hlavaty
Hi Alex,

is there a function to look up an interned symbol?

'intern' does not seem to be doing that:

: (intern NIL)
- NIL
: (pack NIL)
- NIL
: (pack (intern NIL))
- NIL
: 

This behaviour seems a bit strange to me.  I would expect (pack
(intern NIL)) to return NIL...

Thank you,

Tomas
-- 
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe