aboutsummaryrefslogtreecommitdiff
path: root/src/algebra/data.spad.pamphlet
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-02-18 15:37:25 +0000
committerdos-reis <gdr@axiomatics.org>2009-02-18 15:37:25 +0000
commitf04f6bff2bb92b851b5aef56c6846fd01b493d7d (patch)
treec6a1e58944d528c6e4671d891d7dcf4c9804ed7c /src/algebra/data.spad.pamphlet
parent54c2b07353f228554b92269a9a4e688683ae85d6 (diff)
downloadopen-axiom-f04f6bff2bb92b851b5aef56c6846fd01b493d7d.tar.gz
* interp/parse.boot (parseHas): Constants are not attributes.
* interp/compiler.boot (compHasFormat): Handle signature for constants too. * interp/info.boot (actOnInfo): Likewise. * algebra/data.spad.pamphlet (sample$Byte): Make a constant. (SystemInteger): Export constant 'sample'. (SystemNonNegativeInteger): Likewise. * algebra/aggcat2.spad.pamphlet (FiniteLinearAggregateFunctions2): Use 'sample' or 'random' elements when allocating new aggregates.
Diffstat (limited to 'src/algebra/data.spad.pamphlet')
-rw-r--r--src/algebra/data.spad.pamphlet16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/algebra/data.spad.pamphlet b/src/algebra/data.spad.pamphlet
index 43a3b07d..eb69372a 100644
--- a/src/algebra/data.spad.pamphlet
+++ b/src/algebra/data.spad.pamphlet
@@ -33,11 +33,11 @@ Byte(): Public == Private where
++ 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.
+ sample: %
+ ++ \spad{sample} gives a sample datum of type Byte.
Private == SubDomain(NonNegativeInteger, #1 < 256) add
byte(x: NonNegativeInteger): % == per x
- sample() = 0$Lisp
+ sample = 0$Lisp
coerce(c: Character) == per ord c
coerce(x: %): Character == char rep x
x = y == byteEqual(x,y)$Lisp
@@ -91,8 +91,10 @@ ByteOrder(): Public == Private where
++ for system programming tasks, i.e. interfacting with the hosting
++ operating system, reading/writing external binary format files.
SystemInteger(N: PositiveInteger): Public == Private where
- Public == OrderedFinite
+ Public == OrderedFinite with
+ sample: % ++ \spad{sample} gives a sample datum of this type.
Private == SubDomain(Integer, length #1 <= N) add
+ sample == per(0@Integer)
min == per(-shift(1,N-1))
max == per(shift(1,N-1)-1)
size() == (rep max - rep min + 1)::NonNegativeInteger
@@ -159,12 +161,12 @@ SystemNonNegativeInteger(N: PositiveInteger): Public == Private where
++ 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.
+ sample: %
+ ++ \spad{sample} gives a sample datum of type Byte.
Private == SubDomain(NonNegativeInteger, length #1 <= N) add
min == per 0
max == per((shift(1,N)-1)::NonNegativeInteger)
- sample() == min
+ sample == min
bitand(x,y) == BOOLE(BOOLE_-AND$Lisp,x,y)$Lisp
bitior(x,y) == BOOLE(BOOLE_-IOR$Lisp,x,y)$Lisp