How do you read the entire contents of standard input into a string in Newlisp? (i.e the entire remaining contents after the current read position - this operation is commonly called "slurp file")
Asked
Active
Viewed 30 times
1 Answers
1
You can use this:
(define (read-all)
(let (r "" ch "")
(while (setf ch (read-char))
(setf r (append r (char ch))))
r))
See also: http://www.newlisp.org/downloads/newlisp_manual.html#read-char

KIM Taegyoon
- 1,917
- 21
- 18