From: [Invalid-From-Line]
Subject: make-symbol defiencies (how make a direct symbol?)
Date: 
Message-ID: <o2iE6.4$2m.360@client>
I'm trying to make a symbol from a string, but make-symbol works like this:

67. Break [68]> (setq temp `boogie)
BOOGIE
67. Break [68]> (setq temp2 (make-symbol "boogie"))
#:|boogie|
67. Break [68]> (equalp temp temp2)
NIL
67. Break [68]> temp
BOOGIE
67. Break [68]> temp2
#:|boogie|

this means the programmer is going to have to type #:|*| all the time when refering to static symbols, but worse then that, define chokes with the new symbols.

68. Break [69]> (defclass #:|boogie| () ())

*** - There is no package with name "NIL"
69. Break [70]> (defclass boogie () ())
#<Standard-Class BOOGIE #x2039A8B5>

how can i make a "normal" symbol, from a string with that name?

what i'm looking for is something like this:
67. Break [68]> (setq temp2 (make-normal-symbol "boogie"))
boogie
67. Break [68]> (equalp temp temp2)
T

Corey

(the platform i'm using is CLISP with PCL on linux)

From: Dave MacDonald
Subject: Re: make-symbol defiencies (how make a direct symbol?)
Date: 
Message-ID: <871yqmccgs.fsf@sympatico.ca>
<·····@neural.dlsemc.com> writes:

> I'm trying to make a symbol from a string, but make-symbol works like this:
> 
> 67. Break [68]> (setq temp `boogie)
> BOOGIE
> 67. Break [68]> (setq temp2 (make-symbol "boogie"))
> #:|boogie|
> 67. Break [68]> (equalp temp temp2)
> NIL
> 67. Break [68]> temp
> BOOGIE
> 67. Break [68]> temp2
> #:|boogie|
> 

There are two problems here:

First, MAKE-SYMBOL returns a brand new, _uninterned_ symbol, which
means that it will never be EQUALP to an existing symbol. So, you
probably want to use INTERN instead of MAKE-SYMBOL (see
http://www.lisp.org/HyperSpec/Body/fun_intern.html#intern) if you want
the symbols returned by the two given forms to be EQUALP (or EQ). Be
aware that symbols are closely related to packages, and this
relationship is important to fully understanding symbols.

Second, symbols created by the reader (as in the "(setq temp `boogie)"
example above) are by default named with an upcased version of the
string read.  MAKE-SYMBOL (and INTERN as well) use the string argument
to name the symbol, with no changing of case.

So what you probably want is:
[1]> (setq temp 'boogie)
BOOGIE
[2]> (setq temp1 (intern "BOOGIE")) 
BOOGIE
[3]> (eq temp temp1)
T
[4]> (equalp temp temp1)
T
[5]> 

-Dave
From: Lieven Marchand
Subject: Re: make-symbol defiencies (how make a direct symbol?)
Date: 
Message-ID: <m3vgnyfcaa.fsf@localhost.localdomain>
<·····@neural.dlsemc.com> writes:

> I'm trying to make a symbol from a string, but make-symbol works like this:
> 
> 67. Break [68]> (setq temp `boogie)
> BOOGIE
> 67. Break [68]> (setq temp2 (make-symbol "boogie"))
> #:|boogie|
> 67. Break [68]> (equalp temp temp2)
> NIL

Common Lisp is case sensitive. (make-symbol "BOOGIE") would give you a
symbol with the same name as 'boogie. Not the same though, see below.

> 67. Break [68]> temp
> BOOGIE
> 67. Break [68]> temp2
> #:|boogie|
> 
> this means the programmer is going to have to type #:|*| all the time when refering to static symbols, but worse then that, define chokes with the new symbols.
> 

MAKE-SYMBOL also returns uninterned symbols. For a lot of purposes,
you'ld be better of with interned symbols which you can create with
INTERN.

> 68. Break [69]> (defclass #:|boogie| () ())
> 
> *** - There is no package with name "NIL"
> 69. Break [70]> (defclass boogie () ())
> #<Standard-Class BOOGIE #x2039A8B5>
> 
> how can i make a "normal" symbol, from a string with that name?
> 

(intern "BOOGIE")

> what i'm looking for is something like this:
> 67. Break [68]> (setq temp2 (make-normal-symbol "boogie"))
> boogie
> 67. Break [68]> (equalp temp temp2)
> T

This will also depend on the packages in which temp and temp2 are
created in. You might have to call INTERN with its optional package
argument.

-- 
Lieven Marchand <···@wyrd.be>
Gla�r ok reifr skyli gumna hverr, unz sinn b��r bana.