Re: loop macro and multiple-value-bind

Liste des GroupesRevenir à cl scheme 
Sujet : Re: loop macro and multiple-value-bind
De : Nobody447095 (at) *nospam* here-nor-there.org (B. Pym)
Groupes : comp.lang.lisp comp.lang.scheme
Date : 26. Sep 2024, 21:44:08
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vd4h2n$c7sv$1@dont-email.me>
User-Agent : XanaNews/1.18.1.6
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

Date Sujet#  Auteur
26 Sep 24 o Re: loop macro and multiple-value-bind1B. Pym

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal