In Lisp how can I check stream to see if it's empty without modifying it? -
how can check if stream empty without modifying it? @ moment i'm using peek-char see if there character, appears wait user enter if nothing new in stream. also, don't know how compare eof character... #\space won't work. please?
(loop while (equal (peek-char) '#\space) (print 'testword))
you need read manual:
listen checks if there input available.
peek-char can either signal error @ eof or return eof value. can tell eof value return.
Comments
Post a Comment