• map instead of loop

    From B. Pym@21:1/5 to Pascal Costanza on Thu Jul 3 22:28:57 2025
    XPost: comp.lang.scheme

    Pascal Costanza wrote:

    Besides trying to figure out what's more idiomatic, it is also
    (more?) important to note that one of the two expressions traverse
    the list once while the other traverses it twice. Traversing a
    list more often than necessary leads to less efficient code, which
    may or may not matter.

    Apart from that, I tend to prefer LOOP:

    (loop for i in list
    collect (foo (bar i)))

    Gauche Scheme (using function composition)

    (map (.$ foo bar) List)

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