views:

79

answers:

1

Is there a way to dereference a list in lisp?

I am trying to compare 2 strings but one is in a list.

+2  A: 

It sounds like you want car. If your second structure looks like '("string"), then you want

(car '("string"))

If the string is not the first element in the list, you probably want (for example)

(nth 2 '(1 symbol "string"))

Remember to compare strings you want equal, not = which is for numbers only.

Nathan Sanders
There is also `string=`.
Svante
@Svante: And string-equal
Vatine