• Re: loop macro and multiple-value-bind

    From B. Pym@21:1/5 to All on Thu Sep 26 20:44:08 2024
    XPost: comp.lang.scheme

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)