diff options
author | dos-reis <gdr@axiomatics.org> | 2008-09-14 08:25:17 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2008-09-14 08:25:17 +0000 |
commit | 48ce2222cc914d9eb522d0d474b9d48499bb891a (patch) | |
tree | 88ee6ee90d338a9b20387b6174c5ed437a0360de /src/algebra | |
parent | cb2898bace89b16b4deae484375513c12a2d3b47 (diff) | |
download | open-axiom-48ce2222cc914d9eb522d0d474b9d48499bb891a.tar.gz |
* algebra/net.spad.pamphlet (Conduit): New.
(InputByteConduit): Likewise.
(OutputByteConduit): Likewise.
(InputOutputByteConduit): Likewise.
* algebra/exposed.lsp.pamphlet: Expose Conduit, InputByteConduit,
OutputByteConduit, InputOutputByteConduit.
* algebra/Makefile.pamphlet (axiom_algebra_layer_0): Include CONDUIT.
(axiom_algebra_layer_13): Include INBCON, INBCON-, OUTBCON, OUTBCON-.
(axiom_algebra_layer_14): Include IOBCON.
Diffstat (limited to 'src/algebra')
-rw-r--r-- | src/algebra/Makefile.in | 8 | ||||
-rw-r--r-- | src/algebra/Makefile.pamphlet | 8 | ||||
-rw-r--r-- | src/algebra/exposed.lsp.pamphlet | 4 | ||||
-rw-r--r-- | src/algebra/net.spad.pamphlet | 101 |
4 files changed, 115 insertions, 6 deletions
diff --git a/src/algebra/Makefile.in b/src/algebra/Makefile.in index 1c06da1f..0facef02 100644 --- a/src/algebra/Makefile.in +++ b/src/algebra/Makefile.in @@ -363,7 +363,7 @@ axiom_algebra_layer_0 = \ ABELSG- ORDSET ORDSET- FNCAT FILECAT SEXCAT \ MKBCFUNC MKRECORD MKUCFUNC DROPT1 PLOT1 ITFUN2 \ ITFUN3 STREAM1 STREAM2 STREAM3 ANY1 SEGBIND2 \ - COMBOPC EQ2 NONE1 + COMBOPC EQ2 NONE1 CONDUIT axiom_algebra_layer_0_nrlibs = \ $(addsuffix .NRLIB/code.$(FASLEXT),$(axiom_algebra_layer_0)) @@ -569,7 +569,8 @@ axiom_algebra_layer_13 = \ ODESYS ODETOOLS ORDFUNS PERMAN \ PFECAT PFECAT- POINT PSEUDLIN \ PTPACK REP2 SETMN SEX \ - SYMFUNC VECTOR2 CHAR + SYMFUNC VECTOR2 CHAR \ + INBCON INBCON- OUTBCON OUTBCON- axiom_algebra_layer_13_nrlibs = \ $(addsuffix .NRLIB/code.$(FASLEXT),$(axiom_algebra_layer_13)) @@ -636,7 +637,8 @@ axiom_algebra_layer_14 = \ VOID WEIER WP \ EQTBL GSTBL HASHTBL \ INTABL INTFTBL STBL STRTBL\ - TABLE FST SYMS SYMTAB + TABLE FST SYMS SYMTAB \ + IOBCON axiom_algebra_layer_14_nrlibs = \ diff --git a/src/algebra/Makefile.pamphlet b/src/algebra/Makefile.pamphlet index 6073630c..170c5cab 100644 --- a/src/algebra/Makefile.pamphlet +++ b/src/algebra/Makefile.pamphlet @@ -192,7 +192,7 @@ axiom_algebra_layer_0 = \ ABELSG- ORDSET ORDSET- FNCAT FILECAT SEXCAT \ MKBCFUNC MKRECORD MKUCFUNC DROPT1 PLOT1 ITFUN2 \ ITFUN3 STREAM1 STREAM2 STREAM3 ANY1 SEGBIND2 \ - COMBOPC EQ2 NONE1 + COMBOPC EQ2 NONE1 CONDUIT axiom_algebra_layer_0_nrlibs = \ $(addsuffix .NRLIB/code.$(FASLEXT),$(axiom_algebra_layer_0)) @@ -595,7 +595,8 @@ axiom_algebra_layer_13 = \ ODESYS ODETOOLS ORDFUNS PERMAN \ PFECAT PFECAT- POINT PSEUDLIN \ PTPACK REP2 SETMN SEX \ - SYMFUNC VECTOR2 CHAR + SYMFUNC VECTOR2 CHAR \ + INBCON INBCON- OUTBCON OUTBCON- axiom_algebra_layer_13_nrlibs = \ $(addsuffix .NRLIB/code.$(FASLEXT),$(axiom_algebra_layer_13)) @@ -759,7 +760,8 @@ axiom_algebra_layer_14 = \ VOID WEIER WP \ EQTBL GSTBL HASHTBL \ INTABL INTFTBL STBL STRTBL\ - TABLE FST SYMS SYMTAB + TABLE FST SYMS SYMTAB \ + IOBCON axiom_algebra_layer_14_nrlibs = \ diff --git a/src/algebra/exposed.lsp.pamphlet b/src/algebra/exposed.lsp.pamphlet index 4a729c69..a4b5a8c4 100644 --- a/src/algebra/exposed.lsp.pamphlet +++ b/src/algebra/exposed.lsp.pamphlet @@ -572,6 +572,7 @@ (|CombinatorialOpsCategory| . COMBOPC) (|CommutativeRing| . COMRING) (|ComplexCategory| . COMPCAT) + (|Conduit| . CONDUIT) (|ConvertibleTo| . KONVERT) (|DequeueAggregate| . DQAGG) (|Dictionary| . DIAGG) @@ -627,6 +628,8 @@ (|IndexedAggregate| . IXAGG) (|IndexedDirectProductCategory| . IDPC) (|InnerEvalable| . IEVALAB) + (|InputByteConduit| . INBCON) + (|InputOutputByteConduit| IOBCON) (|IntegerNumberSystem| . INS) (|IntegralDomain| . INTDOM) (|IntervalCategory| . INTCAT) @@ -670,6 +673,7 @@ (|OrderedMultisetAggregate| . OMSAGG) (|OrderedRing| . ORDRING) (|OrderedSet| . ORDSET) + (|OutputByteConduit| . OUTBCON) (|PAdicIntegerCategory| . PADICCT) (|PartialDifferentialRing| . PDRING) (|PartialTranscendentalFunctions| . PTRANFN) diff --git a/src/algebra/net.spad.pamphlet b/src/algebra/net.spad.pamphlet index 70130a5b..4a8d4961 100644 --- a/src/algebra/net.spad.pamphlet +++ b/src/algebra/net.spad.pamphlet @@ -11,6 +11,101 @@ \tableofcontents \eject +\section{The Conduit category} + +<<category CONDUIT Conduit>>= +)abbrev category CONDUIT Conduit +++ Author: Gabriel Dos Reis +++ Date Created: August 24, 2008 +++ Date Last Modified: August 24, 2008 +++ Description: +++ This category is the root of the I/O conduits. +Conduit(): Category == with + close!: % -> % + ++ close!(c) closes the conduit c, changing its state to one + ++ that is invalid for future read or write operations. + +@ + +\subsection{The InputByteConduit category} + +<<category INBCON InputByteConduit>>= +)abbrev category INBCON InputByteConduit +++ Author: Gabriel Dos Reis +++ Date Created: August 24, 2008 +++ Date Last Modified: August 24, 2008 +++ Description: +++ This category describes input byte stream conduits. +InputByteConduit(): Category == Conduit with + readByteIfCan!: % -> SingleInteger + ++ readByteIfCan!(cond) attempts to read a byte from the + ++ input conduit `cond'. Returns the read byte if successful, + ++ otherwise return -1. + ++ Note: Ideally, the return value should have been of type + ++ Maybe Byte; but that would have implied allocating + ++ a cons cell for every read attempt, which is overkill. + readBytes!: (%,ByteArray) -> SingleInteger + ++ readBytes!(c,b) reads byte sequences from conduit `c' into + ++ the byte buffer `b'. The actual number of bytes written + ++ is returned. + add + readBytes!(cond,ary) == + count: SingleInteger := 0 + b : SingleInteger + while count < #ary and ((b := readByteIfCan! cond) >= 0) repeat + qsetelt!(ary,count,b : Byte) + count := count + 1 + count + +@ + +\subsection{The OutputByteConduit category} + +<<category OUTBCON OutputByteConduit>>= +)abbrev category OUTBCON OutputByteConduit +++ Author: Gabriel Dos Reis +++ Date Created: August 24, 2008 +++ Date Last Modified: August 24, 2008 +++ Description: +++ This category describes output byte stream conduits. +OutputByteConduit(): Category == Conduit with + writeByteIfCan!: (%,Byte) -> SingleInteger + ++ writeByteIfCan!(c,b) attempts to write the byte `b' on + ++ the conduit `c'. Returns the written byte if successful, + ++ otherwise, returns -1. + ++ Note: Ideally, the return value should have been of type + ++ Maybe Byte; but that would have implied allocating + ++ a cons cell for every write attempt, which is overkill. + writeBytes!: (%,ByteArray) -> SingleInteger + ++ writeBytes!(c,b) write bytes from buffer `b' + ++ onto the conduit `c'. The actual number of written + ++ bytes is returned. + add + writeBytes!(cond,ary) == + count: SingleInteger := 0 + while count < #ary and + writeByteIfCan!(cond,qelt(ary,count)) >= 0 repeat + count := count + 1 + count + +@ + +\subsection{The InputOutputByteConduit category} + +<<category IOBCON InputOutputByteConduit>>= +)abbrev category IOBCON InputOutputByteConduit +++ Author: Gabriel Dos Reis +++ Date Created: August 24, 2008 +++ Date Last Modified: August 24, 2008 +++ See Also: InputByteConduit, OutputByteConduit. +++ Description: +++ This category describes byte stream conduits supporting +++ both input and output operations. +InputOutputByteConduit(): Category == + Join(InputByteConduit,OutputByteConduit) + +@ + \section{The Hostname domain} <<domain HOSTNAME Hostname>>= @@ -94,6 +189,12 @@ PortNumber(): Public == Private where <<*>>= <<license>> + +<<category CONDUIT Conduit>> +<<category INBCON InputByteConduit>> +<<category OUTBCON OutputByteConduit>> +<<category IOBCON InputOutputByteConduit>> + <<domain HOSTNAME Hostname>> <<domain PORTNUM PortNumber>> |