Is this a known limitation (similar to max string size of 0x00ffffff)?
I use pipe to connect through multiple processes (like grep / sort
/uniq,etc) and it is very handy.
I'm hoping that this is a bug and not a limitation...
Try the following code, enter 1500 is OK but if you enter 2000, the
program will abort with a broken pipe.
Thanks,
fungsin
(declare (uses extras regex posix utils))
(require-extension loop)
(require-extension miscmacros)
(define-macro (with-output-to-less . body)
`(with-output-to-pipe "/usr/bin/less -X -E -M" (lambda () ,@body)))
(define (command-loop)
(loop for line = (begin (display "Enter a number or `exit' to quit>
") (read-line))
while (and line (not (eof-object? line)))
if (equal? line "exit") do
(exit)
else do
(let ((n (ignore-errors (string->number line))))
(when n
(with-output-to-less
(repeat n (print "Chicken Chicken Chicken Chicken
Chicken Chicken")))))))
(command-loop)
_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users