aboutsummaryrefslogtreecommitdiff
path: root/src/interp/c-util.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-05-02 05:07:58 +0000
committerdos-reis <gdr@axiomatics.org>2011-05-02 05:07:58 +0000
commit927875aade5720ec0e0cfbe741988011a604678f (patch)
tree27a1edd6e6d161a2b640380584440bc45d4ea621 /src/interp/c-util.boot
parent29e53d366bd313f432aa744b651875f97438586c (diff)
downloadopen-axiom-927875aade5720ec0e0cfbe741988011a604678f.tar.gz
* interp/c-util.boot (categoryRef, domainRef, canonicalForm)
(instantiatorCtor, instantiatorArgs, categoryExports): New.
Diffstat (limited to 'src/interp/c-util.boot')
-rw-r--r--src/interp/c-util.boot32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index a96c8693..7fd42c62 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -49,6 +49,34 @@ module c_-util where
-- functor data manipulation
dbInfovec: %Constructor -> %Maybe %FunctorData
+--% Accessors of domain and category objects
+
+++ Return thr i-th part of a category object
+macro categoryRef(c,i) ==
+ vectorRef(c,i)
+
+++ Return the i-th part of a domain object.
+macro domainRef(d,i) ==
+ vectorRef(d,i)
+
+++ Return the canonical form for a domain or category object
+macro canonicalForm d ==
+ vectorRef(d,0)
+
+++ Return the constructor that instantiates to the domain
+++ or category object
+macro instantiationCtor d ==
+ canonicalForm(d).op
+
+++ Return the canonical forms of the arguments used to instantiate
+++ a domain or a category object.
+macro instantiationArgs d ==
+ canonicalForm(d).args
+
+++ Return the list of operations exported by a category object
+macro categoryExports d ==
+ categoryRef(d,1)
+
--%
$SetCategory ==
'(SetCategory)
@@ -191,9 +219,9 @@ declareUnusedParameters x == (augment x; x) where
devaluate d ==
not vector? d => d
- QVSIZE d > 5 and vectorRef(d,3) is ['Category] => vectorRef(d,0)
+ QVSIZE d > 5 and vectorRef(d,3) is ['Category] => canonicalForm d
QVSIZE d > 0 =>
- d' := vectorRef(d,0)
+ d' := canonicalForm d
isFunctor d' => d'
d
d