aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/data.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-01-06 06:53:21 +0000
committerdos-reis <gdr@axiomatics.org>2009-01-06 06:53:21 +0000
commit258d6427280f1ee0cce0dcdf12c38ad65b5e36cc (patch)
tree7c37449e24bbcfba741729b6d16a71b9c5007ea4 /src/algebra/data.spad.pamphlet
parentbd3fb898659b91542e7a3109f36b2f8b17e05a5d (diff)
downloadopen-axiom-258d6427280f1ee0cce0dcdf12c38ad65b5e36cc.tar.gz
* interp/sys-utility.boot (getVMType): IndexList are lists.
* interp/g-util.boot (isSubDomain): Tidy. * interp/g-opt.boot (isVMConstantForm): New. (findVMFreeVars): Likewise. * interp/define.boot (insertViewMorphisms): Remove. (emitSubdomainInfo): New. (checkVariableName): Likewise. (checkParameterNames): Likewise. (checkRepresentation): Set $subdomain where appropriate. (compDefines): Check parameter names. (compDefineFunctor1): Propagate subdomain info. (doIt): Don't call insertViewMorphisms. * interp/compiler.boot (setqSingle): Check variable name. (compIterator): Likewise. (commonSuperType): New. (satisfies): Likewise. (coerceSubset): Use them to implemen cross-subdomain coercion. (coerceSuperset): New. (comCoerce1): Use it. (compPer): New. (compRep): Likewise. * interp/c-util.boot (getRepresentation): New. (proclaimCapsuleFunction): Improve for specialized subdomains. * algebra/stream.spad.pamphlet: Don't use `per' as variable name. * algebra/si.spad.pamphlet (size$SingleInteger): Tidy. (coerce$SingleInteger): Likewise. * algebra/reclos.spad.pamphlet (nonNull$RealClosure): Don't use `rep' as parameter name. * algebra/data.spad.pamphlet (Byte): Now a subdomain of NonNegativeInteger. Tidy.
Diffstat (limited to 'src/algebra/data.spad.pamphlet')
-rw-r--r--src/algebra/data.spad.pamphlet24
1 files changed, 4 insertions, 20 deletions
diff --git a/src/algebra/data.spad.pamphlet b/src/algebra/data.spad.pamphlet
index 123948b3..d684c59d 100644
--- a/src/algebra/data.spad.pamphlet
+++ b/src/algebra/data.spad.pamphlet
@@ -25,39 +25,23 @@ import OutputForm
++ Description:
++ Byte is the datatype of 8-bit sized unsigned integer values.
Byte(): Public == Private where
- Public == Join(OrderedSet, CoercibleTo NonNegativeInteger,
- HomotopicTo Character) with
+ Public == Join(OrderedSet, HomotopicTo Character) with
byte: NonNegativeInteger -> %
++ byte(x) injects the unsigned integer value `v' into
++ the Byte algebra. `v' must be non-negative and less than 256.
- coerce: NonNegativeInteger -> %
- ++ coerce(x) has the same effect as byte(x).
bitand: (%,%) -> %
++ bitand(x,y) returns the bitwise `and' of `x' and `y'.
bitior: (%,%) -> %
++ bitor(x,y) returns the bitwise `inclusive or' of `x' and `y'.
sample: () -> %
++ sample() returns a sample datum of type Byte.
- Private == add
- byte(x: NonNegativeInteger): % ==
- not (x < 256$Lisp) =>
- userError "integer value cannot be represented by a byte"
- x : %
+ Private == SubDomain(NonNegativeInteger, #1 < 256) add
+ byte(x: NonNegativeInteger): % == x::%
sample() = 0$Lisp
- hash x == SXHASH(x)$Lisp
-
- coerce(x: NonNegativeInteger): % == byte x
- coerce(x: %): NonNegativeInteger == x : NonNegativeInteger
-
coerce(c: Character) == ord(c)::%
- coerce(x: %): Character == char(x::NonNegativeInteger)
-
- coerce(x: %): OutputForm ==
- x::NonNegativeInteger::OutputForm
-
+ coerce(x: %): Character == char rep x
x = y == byteEqual(x,y)$Lisp
x < y == byteLessThan(x,y)$Lisp
-
bitand(x,y) == bitand(x,y)$Lisp
bitior(x,y) == bitior(x,y)$Lisp
@