Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

You will forget that you ever knew me.


comp / comp.lang.lisp / Re: [newbie] I need a function for read user input.

SubjectAuthor
o Re: [newbie] I need a function for read user input.B. Pym

1
Subject: Re: [newbie] I need a function for read user input.
From: B. Pym
Newsgroups: comp.lang.lisp, comp.lang.scheme
Organization: A noiseless patient Spider
Date: Fri, 13 Sep 2024 22:59 UTC
Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Nobody447095@here-nor-there.org (B. Pym)
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=
View all headers

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)

1

rocksolid light 0.9.8
clearnet tor