Skip to content
Snippets Groups Projects
Commit a76eae2f authored by chiles's avatar chiles
Browse files

This commit was generated by cvs2svn to compensate for changes in r3440,

which included commits to RCS files with non-trunk default branches.
parents 86d34389 59ee7a1f
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/ts-stream.lisp,v 1.1.1.7 1991/05/27 13:49:02 chiles Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/hemlock/ts-stream.lisp,v 1.1.1.8 1991/06/10 16:59:22 chiles Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -19,53 +19,6 @@
(in-package "HEMLOCK")
;;;; Public interface from "EXTENSIONS" package.
(in-package "EXT")
(export '(get-stream-command stream-command stream-command-p stream-command-name
stream-command-args make-stream-command))
(defstruct (stream-command (:print-function print-stream-command)
(:constructor make-stream-command
(name &optional args)))
(name nil :type symbol)
(args nil :type list))
(defun print-stream-command (obj str n)
(declare (ignore n))
(format str "#<Stream-Cmd ~S>" (stream-command-name obj)))
;;; GET-STREAM-COMMAND -- Public.
;;;
;;; We can't simply call the stream's misc method because because nil is an
;;; ambiguous return value: does it mean text arrived, or does it mean the
;;; stream's misc method had no :get-command implementation. We can't return
;;; nil until there is text input. We don't need to loop because any stream
;;; implementing :get-command would wait until it had some input. If the
;;; LISTEN fails, then we have some random stream we must wait on.
;;;
(defun get-stream-command (stream)
"This takes a stream and waits for text or a command to appear on it. If
text appears before a command, this returns nil, and otherwise it returns
a command."
(let ((cmdp (funcall (lisp::stream-misc stream) stream :get-command)))
(cond (cmdp)
((listen stream)
nil)
(t
;; This waits for input and returns nil when it arrives.
(unread-char (read-char stream) stream)))))
;;;; Package for rest of file.
(in-package "HEMLOCK")
;;;; Ts-streams.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment