From: Tin Gherdanarra
Subject: make-symbol
Date: 
Message-ID: <4066cnF196jgrU1@individual.net>
Dear cll,

(make-symbol "FOO")

gives me a symbol |FOO|. I understand that
this symbol is a mere value like the
number 5 and does not live very long.
It is not interned (i.e. bound, i.e. put
into the symbol table and pointing to a
value or function). It can be used as
a value to bind to another symbol, though.

In a way this is the same as just quoting
FOO, as in

'FOO

or

(quote foo)

However, this explanation can not account
for the following.

1.) What do those 'quote'-pipe characters mean?
     Why are there no |pipes| around a quoted
     FOO?

2.) Why does (set (make-symbol "FOO") 42)
     throw a type error? What type is |FOO|
     in contrast to FOO?

Thanks for your attention
Tin

From: ········@gmail.com
Subject: Re: make-symbol
Date: 
Message-ID: <1134424316.979396.166680@g44g2000cwa.googlegroups.com>
>2.) Why does (set (make-symbol "FOO") 42)
>     throw a type error? What type is |FOO|
>     in contrast to FOO?

Are you sure your not typing (setf (make-symbol "FOO") 42) and getting
an error?

nick
From: Tin Gherdanarra
Subject: Re: make-symbol
Date: 
Message-ID: <406avlF183kidU2@individual.net>
········@gmail.com wrote:
>>2.) Why does (set (make-symbol "FOO") 42)
>>    throw a type error? What type is |FOO|
>>    in contrast to FOO?
> 
> 
> Are you sure your not typing (setf (make-symbol "FOO") 42) and getting
> an error?

Not any more. See previous posts to the earlier correspondents.
Thanks all the same.

> 
> nick
> 
From: Edi Weitz
Subject: Re: make-symbol
Date: 
Message-ID: <umzj658m0.fsf@agharta.de>
On Mon, 12 Dec 2005 21:55:15 +0100, Tin Gherdanarra <···········@gmail.com> wrote:

> (make-symbol "FOO")
>
> gives me a symbol |FOO|.

Really?  Which implementation are you using?  On all Lisps I have here
I see

  #:FOO

which is what I would have expected.

> In a way this is the same as just quoting FOO

No.

> 1.) What do those 'quote'-pipe characters mean?  Why are there no
> |pipes| around a quoted FOO?

Maybe you have typed (make-symbol "foo") instead?  That would explain
the pipe characters which are escape characters to assure that the
characters between have their case preserved.

There's no direct relation between the pipe character and MAKE-SYMBOL.

> 2.) Why does (set (make-symbol "FOO") 42) throw a type error?

It doesn't signal an error for me.  Again, which CL implementation are
you using?

Cheers,
Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Tin Gherdanarra
Subject: Re: make-symbol
Date: 
Message-ID: <406an5F18q2ttU1@individual.net>
Edi Weitz wrote:

 > On Mon, 12 Dec 2005 21:55:15 +0100, Tin Gherdanarra 
<···········@gmail.com> wrote:
 >
 >
 >> (make-symbol "FOO")
 >>
 >> gives me a symbol |FOO|.
 >
 >
 >
 > Really?  Which implementation are you using?  On all Lisps I have here
 > I see
 >
 >   #:FOO
 >
 > which is what I would have expected.


You are right, of course, but this does not change
the essence of the matter. I'm sorry for this mess.
I toyed with an older implementation to see if it
works there.

 >
 >
 >> In a way this is the same as just quoting FOO
 >
 >
 >
 > No.


Hm.

 >
 >
 >> 1.) What do those 'quote'-pipe characters mean?  Why are there no
 >> |pipes| around a quoted FOO?
 >
 >
 >
 > Maybe you have typed (make-symbol "foo") instead?


You are right. I thought about that and wanted to make
sure that it is the spelling, but appearantly I've
typed "foo". It was a long night.


   That would explain

 > the pipe characters which are escape characters to assure that the
 > characters between have their case preserved.
 >
 > There's no direct relation between the pipe character and MAKE-SYMBOL.


Yesss...

 >
 >
 >> 2.) Why does (set (make-symbol "FOO") 42) throw a type error?
 >
 >
 >
 > It doesn't signal an error for me.  Again, which CL implementation are
 > you using?


Works in SBCL, does not in QLisp.

Thanks.

 >
 > Cheers,
 > Edi.
 >
From: Edi Weitz
Subject: Re: make-symbol
Date: 
Message-ID: <uwtia3pzc.fsf@agharta.de>
On Mon, 12 Dec 2005 23:09:04 +0100, Tin Gherdanarra <···········@gmail.com> wrote:

> Works in SBCL, does not in QLisp.

Never heard of QLisp, looks like it's not ANSI-compliant in this case.

Cheers,
Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: Tin Gherdanarra
Subject: Re: make-symbol
Date: 
Message-ID: <406jlrF18kp2pU1@individual.net>
Edi Weitz wrote:
> On Mon, 12 Dec 2005 23:09:04 +0100, Tin Gherdanarra <···········@gmail.com> wrote:
> 
> 
>>Works in SBCL, does not in QLisp.
> 
> 
> Never heard of QLisp, looks like it's not ANSI-compliant in this case.

I found it on the server. A colleague said it's "old".
I was curious to see if it is CL-compatible. Obviously it's not.


> 
> Cheers,
> Edi.
> 
From: Pascal Bourguignon
Subject: Re: make-symbol
Date: 
Message-ID: <87u0de2f11.fsf@thalassa.informatimago.com>
Tin Gherdanarra <···········@gmail.com> writes:

> Dear cll,
>
> (make-symbol "FOO")
>
> gives me a symbol |FOO|. I understand that
> this symbol is a mere value like the
> number 5 and does not live very long.
> It is not interned (i.e. bound, i.e. put
> into the symbol table and pointing to a
> value or function). It can be used as
> a value to bind to another symbol, though.
>
> In a way this is the same as just quoting
> FOO, as in
>
> 'FOO
>
> or
>
> (quote foo)
>
> However, this explanation can not account
> for the following.
>
> 1.) What do those 'quote'-pipe characters mean?

|ABC| is equivalent to \A\B\C

ABC can be equivalent to |ABC| or to |abc| depending on the readtable case.

>      Why are there no |pipes| around a quoted
>      FOO?

Because they're not needed:

[99]> '|FOO|
FOO
[100]> '|Foo|
|Foo|
[101]> '|foo|
|foo|



> 2.) Why does (set (make-symbol "FOO") 42)
>      throw a type error? What type is |FOO|
>      in contrast to FOO?

All this means you have a strange implementation.

CLISP[92]> (make-symbol "TOTO")
#:TOTO
CLISP[93]> (set (make-symbol "TOTO") 42)
42

#:FOO is the correct reader syntax for uninterned symbols.



[107]> (progn (princ (make-symbol "FOO")) (print (make-symbol "FOO")) (values))
FOO
#:FOO 

The use of the pipe depends on the setting of *print-readably* too:

[109]> (setf *print-readably* t)
|COMMON-LISP|::|T|
[110]> (progn (princ (make-symbol "FOO")) (print (make-symbol "FOO")) (values))
FOO
#:|FOO| 

To be able to read back the correct symbol name FOO, we need to escape
it, because otherwise the reading depends on the readtable case.


Perhaps your reader case is configured in a non-standard way, which
makes it use the | escape for upcase symbol names?



In conclusion: read the CLHS chapters "2. Syntax", '22. Printer" 
and "23. Reader".

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

Nobody can fix the economy.  Nobody can be trusted with their finger
on the button.  Nobody's perfect.  VOTE FOR NOBODY.
From: Tin Gherdanarra
Subject: Re: make-symbol
Date: 
Message-ID: <406auiF183kidU1@individual.net>
Pascal Bourguignon wrote:
> Tin Gherdanarra <···········@gmail.com> writes:
> 
> 
>>Dear cll,
>>
>>(make-symbol "FOO")
>>
>>gives me a symbol |FOO|. I understand that
>>this symbol is a mere value like the
>>number 5 and does not live very long.
>>It is not interned (i.e. bound, i.e. put
>>into the symbol table and pointing to a
>>value or function). It can be used as
>>a value to bind to another symbol, though.
>>
>>In a way this is the same as just quoting
>>FOO, as in
>>
>>'FOO
>>
>>or
>>
>>(quote foo)
>>
>>However, this explanation can not account
>>for the following.
>>
>>1.) What do those 'quote'-pipe characters mean?
> 
> 
> |ABC| is equivalent to \A\B\C
> 
> ABC can be equivalent to |ABC| or to |abc| depending on the readtable case.
> 
> 
>>     Why are there no |pipes| around a quoted
>>     FOO?
> 
> 
> Because they're not needed:
> 
> [99]> '|FOO|
> FOO
> [100]> '|Foo|
> |Foo|
> [101]> '|foo|
> |foo|
> 
> 
Aha. So the pipes prevent uppercasing? That's it?
> 
> 
>>2.) Why does (set (make-symbol "FOO") 42)
>>     throw a type error? What type is |FOO|
>>     in contrast to FOO?
> 
> 
> All this means you have a strange implementation.

I'm using SBCL, but I mixed up two terminal windows
and was connected to QLisp instead of SBCL.

> 
> CLISP[92]> (make-symbol "TOTO")
> #:TOTO
> CLISP[93]> (set (make-symbol "TOTO") 42)
> 42
> 
> #:FOO is the correct reader syntax for uninterned symbols.
> 
> 
> 
> [107]> (progn (princ (make-symbol "FOO")) (print (make-symbol "FOO")) (values))
> FOO
> #:FOO 
> 
> The use of the pipe depends on the setting of *print-readably* too:
> 
> [109]> (setf *print-readably* t)
> |COMMON-LISP|::|T|
> [110]> (progn (princ (make-symbol "FOO")) (print (make-symbol "FOO")) (values))
> FOO
> #:|FOO| 
> 
> To be able to read back the correct symbol name FOO, we need to escape
> it, because otherwise the reading depends on the readtable case.
> 
> 
> Perhaps your reader case is configured in a non-standard way, which
> makes it use the | escape for upcase symbol names?

No it's QLisp. It's old.

> 
> 
> 
> In conclusion: read the CLHS chapters "2. Syntax", '22. Printer" 
> and "23. Reader".

Thanks.

> 
From: Barry Margolin
Subject: Re: make-symbol
Date: 
Message-ID: <barmar-EFABE4.00034513122005@comcast.dca.giganews.com>
In article <···············@individual.net>,
 Tin Gherdanarra <···········@gmail.com> wrote:

> Pascal Bourguignon wrote:
> > [99]> '|FOO|
> > FOO
> > [100]> '|Foo|
> > |Foo|
> > [101]> '|foo|
> > |foo|
> > 
> > 
> Aha. So the pipes prevent uppercasing? That's it?

They also prevent other special character processing.  For instance,

'|(1 2 3)|

is a symbol whose name is "(1 2 3)".  Without the pipes, you'd get a 
list of three numbers.

'|123| is a symbol named "123", not the number one hundred twenty-three.

-- 
Barry Margolin, ······@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***