Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

You are standing on my toes.


comp / comp.lang.lisp / Re: loop macro and multiple-value-bind

SubjectAuthor
o Re: loop macro and multiple-value-bindB. Pym

1
Subject: Re: loop macro and multiple-value-bind
From: B. Pym
Newsgroups: comp.lang.lisp, comp.lang.scheme
Organization: A noiseless patient Spider
Date: Thu, 26 Sep 2024 20:44 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Nobody447095@here-nor-there.org (B. Pym)
Newsgroups: comp.lang.lisp,comp.lang.scheme
Subject: Re: loop macro and multiple-value-bind
Date: Thu, 26 Sep 2024 20:44:08 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <vd4h2n$c7sv$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Injection-Date: Thu, 26 Sep 2024 22:44:08 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="a3b4d1ff5b89e19226be69321ca0bec3";
logging-data="401311"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19f1jAqpxUfheyEpLb2rVxH"
User-Agent: XanaNews/1.18.1.6
Cancel-Lock: sha1:vdp6iBz29IlcP7jppv0LqiOVxeg=
View all headers

> Iterate is a more lispy superset of loop. For instance you can do this:
> (iter
> (for a from 10 to 20)
> (for (values q r) = (truncate a 3))
> (format t "~d ~d~%" q r))
> 3 1
> 3 2
> 4 0
> 4 1
> 4 2
> 5 0
> 5 1
> 5 2
> 6 0
> 6 1
> 6 2

Gauche Scheme

(use srfi-197) ;; chain-lambda

(for-each
(chain-lambda (div-and-mod _ 3) (format #t "~d ~d~%" _ _))
(iota 11 10))

3 1
3 2
4 0
4 1
4 2
5 0
5 1
5 2
6 0
6 1
6 2

1

rocksolid light 0.9.8
clearnet tor