[Chicken-users] Ending input reading without quit csi

2008-01-08 Thread minh thu
Hi,

Say I write in csi somethign like
(for-each-line (lambda (line) (display line)))
which will read from current-input-port,

how can I end the input (if I use ctrl-d, it stops csi too) ?
How can I make csi display another prompt while reading ?

Thanks,
mt


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


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

2008-01-08 Thread felix winkelmann
On Jan 8, 2008 12:09 PM, minh thu [EMAIL PROTECTED] 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


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users


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

2008-01-08 Thread minh thu
2008/1/8, felix winkelmann [EMAIL PROTECTED]:
 On Jan 8, 2008 12:09 PM, minh thu [EMAIL PROTECTED] 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


___
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users