Deutsch   English   Français   Italiano  
<20240912052353.211@kylheku.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!news.nobody.at!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Kaz Kylheku <643-408-1753@kylheku.com>
Newsgroups: comp.lang.lisp,comp.lang.scheme
Subject: Re: concentric loops
Date: Thu, 12 Sep 2024 12:26:44 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 33
Message-ID: <20240912052353.211@kylheku.com>
References: <vbtreg$33ap$1@dont-email.me>
Injection-Date: Thu, 12 Sep 2024 14:26:45 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="fc240c90c706e031471363b92b2225a2";
	logging-data="270113"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18fE/GYexu030WCUHrX36/gRdWR/S6fTBc="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:VK0Wn8Ki9R9oCK8MWsZHUdJxhdY=
Bytes: 1635

On 2024-09-12, B. Pym <Nobody447095@here-nor-there.org> wrote:
> 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))

TXR Lisp:

1> [maprod + (range 10 31 10) 1..4]
(11 12 13 21 22 23 31 32 33)

-- 
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca