Sujet : Re: efficiently accumulating values
De : Nobody447095 (at) *nospam* here-nor-there.org (B. Pym)
Groupes : comp.lang.lispDate : 18. Jun 2025, 12:51:35
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <102u984$33tq6$1@dont-email.me>
User-Agent : XanaNews/1.18.1.6
LOOP is clever enough to do this in a simpler way:
CL-USER> (defun foo (num)
(* num 10))
FOO
CL-USER> (loop for k below 10
collect (foo k))
(0 10 20 30 40 50 60 70 80 90)
CL-USER>
Gauche Scheme
(define foo (cut * 10 <>))
(map foo (iota 10))
===>
(0 10 20 30 40 50 60 70 80 90)