From: Cad Bilbao
Subject: How to use SYMBOL-NAME?
Date: 
Message-ID: <604dab8.0111300808.50895708@posting.google.com>
Hi fellows.

Due to my program flow, I get two Strings:

String1: "Name"
String2: Name

And when trying to compare them both:
(if (string= String1 String2)...
it's always NIL (of course).

I've been told that String2 is a SYMBOL, not a STRING, but if I test:
(if (string= String1 (symbol-name String2))...

I get this error:
Takes a symbol Name

Any suggestion????

From: Wade Humeniuk
Subject: Re: How to use SYMBOL-NAME?
Date: 
Message-ID: <9u8cjh$f4n$1@news3.cadvision.com>
"Cad Bilbao" <···@bilbao.com> wrote in message
································@posting.google.com...
> Hi fellows.
>
> Due to my program flow, I get two Strings:
>
> String1: "Name"
> String2: Name
>
> And when trying to compare them both:
> (if (string= String1 String2)...
> it's always NIL (of course).
>
> I've been told that String2 is a SYMBOL, not a STRING, but if I test:
> (if (string= String1 (symbol-name String2))...
>
> I get this error:
> Takes a symbol Name
>
> Any suggestion????

When you are doing this can you include a copy of your listener/interpreter
session.  Then we can see what you are really doing instead of your
interpretation.  This would really help.

Which Lisp are you using?

Wade
From: Marco Antoniotti
Subject: Re: How to use SYMBOL-NAME?
Date: 
Message-ID: <y6c8zcokyx7.fsf@octagon.mrl.nyu.edu>
···@bilbao.com (Cad Bilbao) writes:

> Hi fellows.
> 
> Due to my program flow, I get two Strings:
> 
> String1: "Name"
> String2: Name

That is not what I see.  `"Name"' is a string, `Name' may be a symbol.

> And when trying to compare them both:
> (if (string= String1 String2)...
> it's always NIL (of course).
> 
> I've been told that String2 is a SYMBOL, not a STRING, but if I test:
> (if (string= String1 (symbol-name String2))...
> 
> I get this error:
> Takes a symbol Name

What Lisp are you using?

> Any suggestion????

A complete piece of code (as well as the answer to the previous
question) will help.

As an aside, you are probably better off to use STRING-EQUAL, instead
of STRING= in this case.

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: Kenny Tilton
Subject: Re: How to use SYMBOL-NAME?
Date: 
Message-ID: <3C07BF7D.2BCD2C14@nyc.rr.com>
Cad Bilbao wrote:
> 
> Hi fellows.
> 
> Due to my program flow, I get two Strings:
> 
> String1: "Name"
> String2: Name
> 
> And when trying to compare them both:
> (if (string= String1 String2)...
> it's always NIL (of course).
> 
> I've been told that String2 is a SYMBOL, not a STRING, but if I test:
> (if (string= String1 (symbol-name String2))...
> 
> I get this error:
> Takes a symbol Name
> 
> Any suggestion????

Before the line which does the string=, print out as much as you can
given your Lisp environment about String2.

In CL i would add:

   (print string2)
   (print (type-of string2))

It might just be a simple bug, in which it turns out String2 is indeed a
string instead of the symbol you expect.

kenny
clinisys