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????
> 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'.
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
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