Sujet : Re: getting list of keys
De : Nobody447095 (at) *nospam* here-nor-there.org (B. Pym)
Groupes : comp.lang.lisp comp.lang.schemeDate : 31. Aug 2024, 00:27:57
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vath1c$ltbf$1@dont-email.me>
User-Agent : XanaNews/1.18.1.6
an `update' function for the mp3 database.
I need a function for doing something like this with a list:
>
* (xxxx (list :artist "something" :song "sss"))
=> (:artist :song)
>
Thanks in advance, and sorry for my bad english.
--
Pablo.
CL-USER> (loop :for (x y) :on (list :artist "something" :song "sss") :by #'cddr
:collect x)
(:ARTIST :SONG)
Gauche Scheme and Racket using unfold from SRFI-1.
(use srfi-1) ;; unfold for Gauche
or
(require srfi/1) ;; unfold for Racket
(unfold null? car cddr '(:artist "something" :song "sss"))
===>
(:artist :song)