[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] [1.89] The symbol .
From: |
felix winkelmann |
Subject: |
Re: [Chicken-users] [1.89] The symbol . |
Date: |
Mon, 25 Apr 2005 17:55:11 +0200 |
On 25 Apr 2005 15:25:26 +0200, Nicolas Pelletier
<address@hidden> wrote:
> Hello,
>
> I would like to represent "the symbol .". This works fine:
>
> #;1> (list 'a (string->symbol ".") 'b)
> (a |.| b)
>
> But this does not:
>
> #;2> (list 'a '|.| 'b)
> Error: invalid use of '.'
> #;2> b
> #;3> (a)
The above expression would be read in as
(list (quote a) (quote .) (quote b))
which is invalid syntax. The second item is still treated as an (invalid)
dotted pair.
>
> I expected the same behaviour as with "the symbol )":
>
> #;4> (list 'a (string->symbol ")") 'b)
> (a |\)| b)
> #;5> (list 'a '|\)| 'b)
> (a |\)| b)
Here the reader specifically scans the input stream for a list
terminator, and so the quoted paren is not recognized as the
delimiter.
>
> Is there a way to input the dot as a symbol literal ?
>
Hm, in fact I can't think of a decent solution right now. It certainly
is somewhat inconsistent. Perhaps I can find a way around this.
cheers,
felix