Sujet : Re: Collection utilities
De : Nobody447095 (at) *nospam* here-nor-there.org (B. Pym)
Groupes : comp.lang.lisp comp.lang.schemeDate : 26. Jun 2025, 02:23:34
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <103i7ek$33hu9$1@dont-email.me>
References : 1
User-Agent : XanaNews/1.18.1.6
B. Pym wrote:
Software Scavenger wrote:
LOOP is powerful, general, and standard. E.g.
CL-USER 5 > (loop as i below 5 collect i collect (* i 2))
(0 0 1 2 2 4 3 6 4 8)
Gauche Scheme
(use srfi-42) ; append-ec
(append-ec (: i 5) (list i (* i 2)))
===>
(0 0 1 2 2 4 3 6 4 8)
Shorter yet.
(append-ec (: i 5) `(,i ,(* i 2)))