chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Ending input reading without quit csi


From: minh thu
Subject: Re: [Chicken-users] Ending input reading without quit csi
Date: Tue, 8 Jan 2008 12:36:23 +0100

2008/1/8, felix winkelmann <address@hidden>:
> On Jan 8, 2008 12:09 PM, minh thu <address@hidden> wrote:
> > Hi,
> >
> > Say I write in csi somethign like
> > (for-each-line (lambda (line) (display line)))
> > which will read from current-input-port,
>
> Correct.
>
> >
> > how can I end the input (if I use ctrl-d, it stops csi too) ?
>
> You will have to handle it yourself. One way would be to
> check the input (say, an empty line) and abort the iteration:
>
> (call/cc
>   (lambda (continue)
>     (for-each-line
>       (lambda (line)
>         (when (string=? "" line) (continue #f))
>         ...))))
>
> > How can I make csi display another prompt while reading ?
>
> #;1> (repl-prompt (lambda () "::: "))
> ::: 123
> 123
> ::: 456
> 456
> ::: (+ 3 4)
> 7
>
>
> cheers,
> felix
>

Great, thanks
thu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]