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)
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)
The one place I find myself frequently using CDD*R
is in destructuring lists by "gulps" in LOOP, e.g.:
> (defun group-by-triples (list)
(loop for (a b c) on list by #'cdddr
collect (list a b c)))
GROUP-BY-TRIPLES
> (group-by-triples '(0 1 2 3 4 5 6 7 8 9 10 11 12))
((0 1 2) (3 4 5) (6 7 8) (9 10 11) (12 NIL NIL))
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)
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 76 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 55:33:26 |
| Calls: | 1,265 |
| Calls today: | 1 |
| Files: | 1,362 |
| D/L today: |
3 files (2,684K bytes) |
| Messages: | 285,684 |