"Jordon Hirshon" <·········@worldnet.att.net> writes:
> How can I turn a string into a list of symbols? (Not a list of characters).
* (map 'list (lambda (c) (intern (string c))) "Foobar")
(F |o| |o| |b| |a| |r|)
And there a couple of other ways to do this as well. But are you sure
you want/need this?
Edi.
"Jordon Hirshon" <·········@worldnet.att.net> writes:
> How can I turn a string into a list of symbols? (Not a list of characters).
Well, depends on the exact semantics you want.
Anyway, look up the function INTERN in the hyperspec:
| * (intern "FOO")
| FOO
| NIL
| * (symbolp (intern "BAR"))
| T
| *
| * (eq (intern "BAZ") 'baz)
| T
And perhaps SPLIT-SEQUENCE may be useful, see
<http://www.cliki.net/split-sequence>.
hth
Henrik
"Jordon Hirshon" <·········@worldnet.att.net> writes:
> How can I turn a string into a list of symbols? (Not a list of characters).
Something like this?
[12]> (let ((string "foo bar baz"))
(read-from-string (concatenate 'string "(" string ")")))
(FOO BAR BAZ) ;
13
You may want to bind *print-eval*
--
Eduardo Mu�oz
Hi Jordon Hirshon,
> How can I turn a string into a list of symbols? (Not a list of characters).
(loop for char across string collect (intern (string char)))
Regards,
Adam