Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to use SYMBOL-NAME?

2 views
Skip to first unread message

Cad Bilbao

unread,
Nov 30, 2001, 11:08:30 AM11/30/01
to
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????

Marco Antoniotti

unread,
Nov 30, 2001, 11:26:28 AM11/30/01
to

c...@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'.

Wade Humeniuk

unread,
Nov 30, 2001, 11:37:16 AM11/30/01
to

"Cad Bilbao" <c...@bilbao.com> wrote in message
news:604dab8.01113...@posting.google.com...

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


Kenny Tilton

unread,
Nov 30, 2001, 12:16:13 PM11/30/01
to

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

0 new messages