• Re: A critic of Guido's blog on Python's lambda

    From B. Pym@21:1/5 to All on Sun Sep 8 22:05:48 2024
    (iter (for x in '(1 -3 2))
    (finding x maximizing (abs x))) => -3

    Gauche Scheme

    (use gauche.collection :only (find-max))
    (find-max '(1 -3 2) :key abs)

    -3

    Portable Standard Lisp:

    (load useful)

    (for (in x '(1 -3 2))
    (maximal x (abs x)))

    -3

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From B. Pym@21:1/5 to Bill Atkins on Thu Jun 26 21:48:11 2025
    Bill Atkins wrote:

    The cool thing about ITERATE is that it lets you express looping
    concepts in a language designed explicitly for such a purpose, e.g.

    (iter (for x in '(1 3 3))
    (summing x)) => 7

    Scheme

    (fold + 0 '(1 3 5 7 9))
    ===>
    25

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From B. Pym@21:1/5 to B. Pym on Thu Jun 26 21:53:32 2025
    B. Pym wrote:

    Bill Atkins wrote:

    The cool thing about ITERATE is that it lets you express looping
    concepts in a language designed explicitly for such a purpose, e.g.

    (iter (for x in '(1 3 3))
    (summing x)) => 7

    Scheme

    (fold + 0 '(1 3 5 7 9))
    ===>
    25



    (iter (for x in '(1 -3 2))
    (finding x maximizing (abs x))) => -3

    Gauche Scheme

    (use gauche.collection :only (find-max))
    (find-max '(1 -3 2) :key abs)

    -3

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