• Re: [newbie] I need a function for read user input.

    From B. Pym@21:1/5 to Gareth McCaughan on Fri Sep 13 22:59:53 2024
    XPost: comp.lang.lisp

    Gareth McCaughan wrote:

    (loop for word = (read input nil) while word collect word)

    which even the strictest LOOP-hater would have to agree
    is clearer.

    It's shorter in Gauche Scheme:

    (use gauche.generator)

    (generator->list (cut read input))


    Another way:

    (use srfi-42) ; list-ec

    (list-ec (:port word input) word)


    Another way.

    (lope doport word read port collecting word)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From B. Pym@21:1/5 to B. Pym on Mon Jul 7 20:19:27 2025
    XPost: comp.lang.lisp

    B. Pym wrote:

    Another way:

    (use srfi-42) ; list-ec

    (list-ec (:port word input) word)

    Shorter:

    (define input (current-input-port))

    (list-ec (: word input) word)

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