aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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