Commit 7cad2c8e authored by Daniel Kochmański's avatar Daniel Kochmański

types: introduce ext:virtual-stream type

This type applies to all streams which doesn't have a
descriptor (gray:fundamental-stream and string-stream for now).
parent fb90d28a
......@@ -2019,6 +2019,7 @@ cl_symbols[] = {
{EXT_ "ARRAY-INDEX", EXT_ORDINARY, NULL, -1, OBJNULL},
{EXT_ "ANSI-STREAM", EXT_ORDINARY, NULL, -1, OBJNULL},
{EXT_ "VIRTUAL-STREAM", EXT_ORDINARY, NULL, -1, OBJNULL},
{EXT_ "COMPLEX-ARRAY", EXT_ORDINARY, NULL, -1, OBJNULL},
......
......@@ -2019,6 +2019,7 @@ cl_symbols[] = {
{EXT_ "ARRAY-INDEX",NULL},
{EXT_ "ANSI-STREAM",NULL},
{EXT_ "VIRTUAL-STREAM",NULL},
{EXT_ "COMPLEX-ARRAY",NULL},
......
......@@ -325,6 +325,10 @@ and is not adjustable."
(deftype array-index ()
'(integer 0 #.(1- array-dimension-limit)))
(deftype ext:virtual-stream ()
'(or string-stream
#+clos-streams gray:fundamental-stream))
;;************************************************************
;; TYPEP
;;************************************************************
......@@ -1317,6 +1321,7 @@ if not possible."
#+clos-streams (GRAY:FUNDAMENTAL-STREAM)
(STREAM (OR EXT:ANSI-STREAM
#+clos-streams GRAY:FUNDAMENTAL-STREAM))
(EXT:VIRTUAL-STREAM (OR STRING-STREAM #+clos-streams GRAY:FUNDAMENTAL-STREAM))
(READTABLE)
#+threads (MP::PROCESS)
......
......@@ -116,8 +116,8 @@
(pathnamep which))
(apply #'open which :external-format external-format args))
#+clos-streams
((typep which 'gray:fundamental-stream)
:gray-stream)
((typep which 'virtual-stream)
:virtual-stream)
((or (eql which :stream)
(streamp which))
which)
......@@ -162,23 +162,23 @@
(si:spawn-subprocess progname args environ
(case process-input
((nil) (null-stream :output))
(:gray-stream :stream)
(:virtual-stream :stream)
(otherwise process-input))
(case process-output
((nil) (null-stream :input))
(:gray-stream :stream)
(:virtual-stream :stream)
(otherwise process-output))
(case process-error
((nil) (null-stream :input))
(:gray-stream :stream)
(:virtual-stream :stream)
(otherwise process-error))))
(when (eql process-input :gray-stream)
(warn "EXT:RUN-PROGRAM: Ignoring gray stream as :INPUT argument."))
(when (eql process-output :gray-stream)
(warn "EXT:RUN-PROGRAM: Ignoring gray stream as :OUTPUT argument."))
(when (eql process-error :gray-stream)
(warn "EXT:RUN-PROGRAM: Ignoring gray stream as :ERROR argument."))
(when (eql process-input :virtual-stream)
(warn "EXT:RUN-PROGRAM: Ignoring virtual stream as :INPUT argument."))
(when (eql process-output :virtual-stream)
(warn "EXT:RUN-PROGRAM: Ignoring virtual stream as :OUTPUT argument."))
(when (eql process-error :virtual-stream)
(warn "EXT:RUN-PROGRAM: Ignoring virtual stream as :ERROR argument."))
(let ((stream-write
(when (plusp parent-write)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment