Deutsch   English   Français   Italiano  
<vc2g58$12ukb$2@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: "B. Pym" <Nobody447095@here-nor-there.org>
Newsgroups: comp.lang.lisp,comp.lang.scheme
Subject: Re: [newbie] I need a function for read user input.
Date: Fri, 13 Sep 2024 22:59:53 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <vc2g58$12ukb$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Injection-Date: Sat, 14 Sep 2024 00:59:53 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="ee687035ab0f3367b9efcf5ae7f07364";
	logging-data="1145483"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/s22W13OTRmwFME6fAgsgA"
User-Agent: XanaNews/1.18.1.6
Cancel-Lock: sha1:GDFrlSLLat2jy67dC5rpGilgwv0=
Bytes: 1282

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)