Re: getting list of keys

Liste des GroupesRevenir à cl lisp 
Sujet : Re: getting list of keys
De : Nobody447095 (at) *nospam* here-nor-there.org (B. Pym)
Groupes : comp.lang.lisp comp.lang.scheme
Date : 02. Jul 2025, 10:35:42
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <1042uhb$3eho4$1@dont-email.me>
References : 1
User-Agent : XanaNews/1.18.1.6
B. Pym wrote:

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)

Gauche Scheme

(use gauche.lazy)  ;; lslices

(map car (lslices '(:artist "something" :song "sss") 2))
  ===>
(:artist :song)



Date Sujet#  Auteur
30 Aug 24 * Re: getting list of keys3B. Pym
31 Aug 24 +- Re: getting list of keys1B. Pym
2 Jul10:35 `- Re: getting list of keys1B. Pym

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal