How to search through a plist repeatedly?

I am trying to learn LISP and I'm getting hung up on something basic -

I want to loop through a list and lookup a plist value from the list value...

; here it just looks up the plist value 
(defun get-plist-value(x) (getf (list :a "1" :b "2") x))


; this is what i want to do, but it doesnt work 
; i have tried concatenating the ":" before the x value, but it didnt work either 
(loop for x in '(a b) do (get-plist-value x))

; this works 
(get-plist-value :a)

thank you :-)

5
задан sds 18 March 2013 в 17:39
поделиться