I have this association-list:
- Code: Select all
(defvar base-list (list (cons 'a 0) (cons 2 'c)))
I have to call assoc when my argument is of type string.
So for the pair
- Code: Select all
(A . 0)
- Code: Select all
(2 . C)
This should work like this:
- Code: Select all
CL-USER 28 : 1 > (assoc (convert-string-to-symbol "a") base-list)
(A . 0)
CL-USER 28 : 1 > (assoc (convert-number-to-symbol "2") base-list)
(2 . C)
I tried using intern but got NIL:
- Code: Select all
CL-USER 29 : 1 > (assoc (intern "a") base-list)
NIL
Thanks a lot