Re: concentric loops

Liste des GroupesRevenir à cl scheme 
Sujet : Re: concentric loops
De : Nobody447095 (at) *nospam* here-nor-there.org (B. Pym)
Groupes : comp.lang.lisp comp.lang.scheme
Date : 12. Sep 2024, 06:41:56
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vbtreg$33ap$1@dont-email.me>
User-Agent : XanaNews/1.18.1.6
Peter Seibel wrote:

--> ( 11 12 13 21 22 23 31 32 33)
>
I know that in CL plus is replaced by +, but how can I
handle the mapcar inside the mapcan?
 
(loop for x from 10 to 30 by 10 nconcing
   (loop for y from 1 to 3 collect (+ x y)))

Gauche Scheme

(use srfi-42) ; list-ec

(list-ec (:range x 10 31 10) (:range y 1 4) (+ x y))

  ===>
(11 12 13 21 22 23 31 32 33)

Shorter:

(list-ec (: x 10 31 10) (: y 1 4) (+ x y))

Date Sujet#  Auteur
12 Sep 24 * Re: concentric loops2B. Pym
12 Sep 24 `- Re: concentric loops1Kaz Kylheku

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal