[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] Ending input reading without quit csi
From: |
felix winkelmann |
Subject: |
Re: [Chicken-users] Ending input reading without quit csi |
Date: |
Tue, 8 Jan 2008 12:18:17 +0100 |
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