aboutsummaryrefslogtreecommitdiff
path: root/src/algebra
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2007-12-02 18:04:48 +0000
committerdos-reis <gdr@axiomatics.org>2007-12-02 18:04:48 +0000
commit343269a2cb9ba10117847c36636dc31bad7404ab (patch)
treebd1ca5251637386b706eaadaf2f5dc9d4e7b6fa4 /src/algebra
parent0a95a6448e71e1d2dae08cafab5bf33426f17e61 (diff)
downloadopen-axiom-343269a2cb9ba10117847c36636dc31bad7404ab.tar.gz
* bags.spad.pamphlet (Stack): Relax requirement element type S.
(coerce$Stack: % -> OutputForm): Define only if S has CoercibleTo OutputForm. (=$Stack: (%, %) -> Boolean): Define only if S has SetCategory.
Diffstat (limited to 'src/algebra')
-rw-r--r--src/algebra/ChangeLog7
-rw-r--r--src/algebra/bags.spad.pamphlet15
2 files changed, 18 insertions, 4 deletions
diff --git a/src/algebra/ChangeLog b/src/algebra/ChangeLog
index d44a5731..2e9ad98f 100644
--- a/src/algebra/ChangeLog
+++ b/src/algebra/ChangeLog
@@ -1,5 +1,12 @@
2007-12-02 Gabriel Dos Reis <gdr@cs.tamu.edu>
+ * bags.spad.pamphlet (Stack): Relax requirement element type S.
+ (coerce$Stack: % -> OutputForm): Define only if S has CoercibleTo
+ OutputForm.
+ (=$Stack: (%, %) -> Boolean): Define only if S has SetCategory.
+
+2007-12-02 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
* syntax.spad (buildSyntax): Overload on first argument type.
2007-11-15 Gabriel Dos Reis <gdr@cs.tamu.edu>
diff --git a/src/algebra/bags.spad.pamphlet b/src/algebra/bags.spad.pamphlet
index 8e1c3356..a00b49e6 100644
--- a/src/algebra/bags.spad.pamphlet
+++ b/src/algebra/bags.spad.pamphlet
@@ -14,7 +14,7 @@
)abbrev domain STACK Stack
++ Author: Michael Monagan and Stephen Watt
++ Date Created:June 86 and July 87
-++ Date Last Updated:Feb 92
+++ Date Last Updated: December 02, 2007
++ Basic Operations:
++ Related Domains:
++ Also See:
@@ -27,14 +27,21 @@
++ Linked List implementation of a Stack
--% Dequeue and Heap data types
-Stack(S:SetCategory): StackAggregate S with
+Stack(S: Type): StackAggregate S with
stack: List S -> %
++ stack([x,y,...,z]) creates a stack with first (top)
++ element x, second element y,...,and last element z.
== add
Rep := Reference List S
- s = t == deref s = deref t
- coerce(d:%): OutputForm == bracket [e::OutputForm for e in deref d]
+
+ if S has CoercibleTo OutputForm then
+ coerce(d:%): OutputForm ==
+ bracket [e::OutputForm for e in deref d]
+
+ if S has SetCategory then
+ s = t ==
+ deref s = deref t
+
copy s == ref copy deref s
depth s == # deref s
# s == depth s