From: Malauss�ne
Subject: [Common Lisp] String => Symbol
Date: 
Message-ID: <aak88g$pg3$1@wanadoo.fr>
Hi,

I look for a method to transform a list of string expression in list of
symbol expression.
An example :
I have : ( "a" "b" "c")
I would ( a b c) or ( A B C )

Thanks you in advance.

--
 Malauss�ne

From: Thomas F. Burdick
Subject: Re: [Common Lisp] String => Symbol
Date: 
Message-ID: <xcvd6wi5ld7.fsf@conquest.OCF.Berkeley.EDU>
"Malauss�ne" <·······@wanadoo.fr> writes:

> Hi,
> 
> I look for a method to transform a list of string expression in list of
> symbol expression.
> An example :
> I have : ( "a" "b" "c")
> I would ( a b c) or ( A B C )
> 
> Thanks you in advance.

Well, you can do that with

  (let ((*package* ...)) ; you want to control where these symbols get interned
    (mapcar #'intern string-list))

But that's kind of a weird thing to do.  So, to back up a minute, why
do you think you want to do this?

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: Malauss�ne
Subject: Re: [Common Lisp] String => Symbol
Date: 
Message-ID: <aaka35$r71$1@wanadoo.fr>
"Thomas F. Burdick" <···@conquest.OCF.Berkeley.EDU> a �crit dans le message
de news: ···············@conquest.OCF.Berkeley.EDU...
> "Malauss�ne" <·······@wanadoo.fr> writes:
>
> > Hi,
> > I look for a method to transform a list of string expression in list of
> > symbol expression.
> > An example :
> > I have : ( "a" "b" "c")
> > I would ( a b c) or ( A B C )
> > Thanks you in advance.
>
> Well, you can do that with
>   (let ((*package* ...)) ; you want to control where these symbols get
interned
>     (mapcar #'intern string-list))
>
> But that's kind of a weird thing to do.  So, to back up a minute, why
> do you think you want to do this?

Do you have a simpler method ?!!
I look for easilier method to transform a string in symbol. I use a function
which returns the string but i need a symbol or a string without the quotes.

--
 Malauss�ne
From: Thomas F. Burdick
Subject: Re: [Common Lisp] String => Symbol
Date: 
Message-ID: <xcvadrm5k1k.fsf@conquest.OCF.Berkeley.EDU>
"Malauss�ne" <·······@wanadoo.fr> writes:

> Do you have a simpler method ?!!
> I look for easilier method to transform a string in symbol. I use a function
> which returns the string but i need a symbol or a string without the quotes.

I meant that question in a broader sense: what are you trying to accomplish here?

-- 
           /|_     .-----------------------.                        
         ,'  .\  / | No to Imperialist war |                        
     ,--'    _,'   | Wage class war!       |                        
    /       /      `-----------------------'                        
   (   -.  |                               
   |     ) |                               
  (`-.  '--.)                              
   `. )----'                               
From: Malauss�ne
Subject: Re: [Common Lisp] String => Symbol
Date: 
Message-ID: <aakb6h$i8$1@wanadoo.fr>
"Thomas F. Burdick" <···@conquest.OCF.Berkeley.EDU> a �crit dans le message
de news: ···············@conquest.OCF.Berkeley.EDU...
> "Malauss�ne" <·······@wanadoo.fr> writes:
>
> > Do you have a simpler method ?!!
> > I look for easilier method to transform a string in symbol. I use a
function
> > which returns the string but i need a symbol or a string without the
quotes.
>
> I meant that question in a broader sense: what are you trying to
accomplish here?

I'm trying to transform a word (string) in symbol for evaluate its. For
example, i have "print" "i" (i is a variable) and i would like eval (print
i).
The read-from-string function seems very nice. I will try it.

Thank you all.

--
 Malauss�ne
From: Marco Antoniotti
Subject: Re: [Common Lisp] String => Symbol
Date: 
Message-ID: <y6cpu0hmeez.fsf@octagon.mrl.nyu.edu>
"Malauss�ne" <·······@wanadoo.fr> writes:

> "Thomas F. Burdick" <···@conquest.OCF.Berkeley.EDU> a �crit dans le message
> de news: ···············@conquest.OCF.Berkeley.EDU...
> > "Malauss�ne" <·······@wanadoo.fr> writes:
> >
> > > Do you have a simpler method ?!!
> > > I look for easilier method to transform a string in symbol. I use a
> function
> > > which returns the string but i need a symbol or a string without the
> quotes.
> >
> > I meant that question in a broader sense: what are you trying to
> accomplish here?
> 
> I'm trying to transform a word (string) in symbol for evaluate its. For
> example, i have "print" "i" (i is a variable) and i would like eval (print
> i).

I see signs of Perlite here, with Tclite complications.

> The read-from-string function seems very nice. I will try it.

Read about READ and the reader. :)  It is goo medicine.

Cheers


-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group        tel. +1 - 212 - 998 3488
719 Broadway 12th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA                 http://bioinformatics.cat.nyu.edu
                    "Hello New York! We'll do what we can!"
                           Bill Murray in `Ghostbusters'.
From: Marco Antoniotti
Subject: Re: [Common Lisp] String => Symbol
Date: 
Message-ID: <y6clmb5mecy.fsf@octagon.mrl.nyu.edu>
Off Topic....

"Malauss�ne" <·······@wanadoo.fr> writes:

> "Thomas F. Burdick" <···@conquest.OCF.Berkeley.EDU> a �crit dans le message
> de news: ···············@conquest.OCF.Berkeley.EDU...
> > "Malauss�ne" <·······@wanadoo.fr> writes:

> I'm trying to transform a word (string) in symbol for evaluate its. For
> example, i have "print" "i" (i is a variable) and i would like eval (print
> i).
> The read-from-string function seems very nice. I will try it.

Are you "scapegoating" for some Perl programmer? :)

Cheers

-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group        tel. +1 - 212 - 998 3488
719 Broadway 12th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA                 http://bioinformatics.cat.nyu.edu
                    "Hello New York! We'll do what we can!"
                           Bill Murray in `Ghostbusters'.
From: Malauss�ne
Subject: Re: [Common Lisp] String => Symbol
Date: 
Message-ID: <aamlvs$8md$1@wanadoo.fr>
"Marco Antoniotti" <·······@cs.nyu.edu> a �crit dans le message de news:
···············@octagon.mrl.nyu.edu...
>
> Off Topic....
>
> "Malauss�ne" <·······@wanadoo.fr> writes:
> > "Thomas F. Burdick" <···@conquest.OCF.Berkeley.EDU> a �crit dans le
message
> > de news: ···············@conquest.OCF.Berkeley.EDU...
> > I'm trying to transform a word (string) in symbol for evaluate its. For
> > example, i have "print" "i" (i is a variable) and i would like eval
(print
> > i).
> > The read-from-string function seems very nice. I will try it.
> Are you "scapegoating" for some Perl programmer? :)

 I'm sorry, i don't understand your private joke (i'm french).

--
 Malauss�ne
From: Paul Dietz
Subject: Re: [Common Lisp] String => Symbol
Date: 
Message-ID: <3CCDB10B.4760B2DA@motorola.com>
"Malauss�ne" wrote:

> > Well, you can do that with
> >   (let ((*package* ...)) ; you want to control where these symbols get
> interned
> >     (mapcar #'intern string-list))
> >
> > But that's kind of a weird thing to do.  So, to back up a minute, why
> > do you think you want to do this?
> 
> Do you have a simpler method ?!!


Good grief.  That *is* a simple method.  Were you expecting
there to be a single function that does this?

	Paul
From: Barry Margolin
Subject: Re: [Common Lisp] String => Symbol
Date: 
Message-ID: <F%hz8.34$0j2.865@paloalto-snr2.gtei.net>
In article <············@wanadoo.fr>, Malauss�ne <·······@wanadoo.fr> wrote:
>
>"Thomas F. Burdick" <···@conquest.OCF.Berkeley.EDU> a �crit dans le message
>de news: ···············@conquest.OCF.Berkeley.EDU...
>> But that's kind of a weird thing to do.  So, to back up a minute, why
>> do you think you want to do this?
>
>Do you have a simpler method ?!!
>I look for easilier method to transform a string in symbol. I use a function
>which returns the string but i need a symbol or a string without the quotes.

Why do you need a symbol?  Why can't you just use the string?

And what do you mean by "a string without the quotes"?  The quotes aren't
part of the string, they're just part of the string's printed
representation.  If you print it with FORMAT's ~A format control, the
quotes won't be printed.

-- 
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Barry Margolin
Subject: Re: [Common Lisp] String => Symbol
Date: 
Message-ID: <Axhz8.22$Vo2.371@paloalto-snr1.gtei.net>
In article <············@wanadoo.fr>, Malauss�ne <·······@wanadoo.fr> wrote:
>Hi,
>
>I look for a method to transform a list of string expression in list of
>symbol expression.
>An example :
>I have : ( "a" "b" "c")
>I would ( a b c) or ( A B C )
>
>Thanks you in advance.

Use MAPCAR with either INTERN, MAKE-SYMBOL, or READ-FROM-STRING, depending
on your precise needs.

-- 
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Malauss�ne
Subject: Re: [Common Lisp] String => Symbol
Date: 
Message-ID: <aakbin$2jp$1@wanadoo.fr>
"Barry Margolin" <······@genuity.net> a �crit dans le message de news:
················@paloalto-snr1.gtei.net...
> In article <············@wanadoo.fr>, Malauss�ne <·······@wanadoo.fr>
wrote:
> >Hi,
> >
> >I look for a method to transform a list of string expression in list of
> >symbol expression.
> >An example :
> >I have : ( "a" "b" "c")
> >I would ( a b c) or ( A B C )
> >
> >Thanks you in advance.
>
> Use MAPCAR with either INTERN, MAKE-SYMBOL, or READ-FROM-STRING, depending
> on your precise needs.

I think that i going to use 'read-from-string' but i tried the make-symbol
function and i had surprised by the result.
(make-symbol "TOTO") returns #:TOTO. Why? What is it represent by '#:' ??

--
 Malauss�ne
From: Barry Margolin
Subject: Re: [Common Lisp] String => Symbol
Date: 
Message-ID: <pJiz8.24$Vo2.77@paloalto-snr1.gtei.net>
In article <············@wanadoo.fr>, Malauss�ne <·······@wanadoo.fr> wrote:
>I think that i going to use 'read-from-string' but i tried the make-symbol
>function and i had surprised by the result.
>(make-symbol "TOTO") returns #:TOTO. Why? What is it represent by '#:' ??

That indicates that the symbol isn't interned in any package.  Read the
documentation of INTERN and MAKE-SYMBOL and compare them.

-- 
Barry Margolin, ······@genuity.net
Genuity, Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.
From: Hannah Schroeter
Subject: Re: [Common Lisp] String => Symbol
Date: 
Message-ID: <aak9dv$ejf$1@c3po.schlund.de>
Hello!

In article <············@wanadoo.fr>, Malauss�ne <·······@wanadoo.fr> wrote:

>I look for a method to transform a list of string expression in list of
>symbol expression.
>An example :
>I have : ( "a" "b" "c")
>I would ( a b c) or ( A B C )

Depending on what you want, you should look at either
#'intern or #'make-symbol (the HyperSpec is your friend).

For lifting that functionality to lists, have a look at #'mapcar,
perhaps coupled with some lambda'ing.

Kind regards,

Hannah.