How do i iterate and print the keys of a plist based on given values?
Example:
; plist
(defun my-list() (list :a "hi" :b "no" :c "go"))
; from that list i want to iterate and print out keys based on values like:
for each x in ("hi" "go") print x
; hoping for:
ac
Im new to lisp - thank you :-)
Something like
(loop for (key value) on my-list by #'cddr
when (member value '("hi" "go") :test #'equal)
do (princ key))
The first line moves a pattern over the list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With