aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/c-util.boot4
-rw-r--r--src/interp/category.boot37
2 files changed, 19 insertions, 22 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index b1ac64ed..dd597a88 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -77,6 +77,10 @@ macro instantiationArgs d ==
macro categoryExports d ==
categoryRef(d,1)
+++ Return the attribute alist of a category object.
+macro categoryAttributes d ==
+ categoryRef(d,2)
+
++ Return the predicate values associated with the domain object.
++ This is an integer interpreted as bit vector
macro domainPredicates d ==
diff --git a/src/interp/category.boot b/src/interp/category.boot
index 53079f37..11abb5c3 100644
--- a/src/interp/category.boot
+++ b/src/interp/category.boot
@@ -137,25 +137,27 @@ mkCategory(domainOrPackage,sigList,attList,domList,PrincipalAncestor) ==
v := newShell count
canonicalForm(v) := nil
categoryExports(v) := sigList
- v.2 := attList
- v.3 := $Category
+ categoryAttributes(v) := attList
+ categoryRef(v,3) := $Category
if PrincipalAncestor ~= nil then
for x in 6..#PrincipalAncestor-1 repeat
- v.x := PrincipalAncestor.x
- v.4 := [first PrincipalAncestor.4,second PrincipalAncestor.4,OldLocals]
- else v.4 := [nil,nil,OldLocals] --associated categories and domains
- v.5 := domList
- for [nsig,:sequence] in NSigList repeat
- v.sequence := nsig
+ categoryRef(v,x) := PrincipalAncestor.x
+ categoryRef(v,4) :=
+ [first PrincipalAncestor.4,second PrincipalAncestor.4,OldLocals]
+ else
+ categoryRef(v,4) := [nil,nil,OldLocals] --associated categories and domains
+ categoryRef(v,5) := domList
+ for [nsig,:n] in NSigList repeat
+ categoryRef(v,n) := nsig
v
--% Subsumption code (for operators)
-DropImplementations (a is [sig,pred,:implem]) ==
- if implem is [[q,:.]] and (q="ELT" or q="CONST")
- then if (q="ELT") then [sig,pred]
- else [[:sig,:'(constant)],pred]
- else a
+DropImplementations a ==
+ a is [sig,pred,[q,:.]] and q in '(ELT CONST) =>
+ q = "ELT" => [sig,pred]
+ [[:sig,'constant],pred]
+ a
SigListUnion(extra,original) ==
--augments original %with everything in extra that is not in original
@@ -567,12 +569,3 @@ Join(:l) ==
null $e or $InteractiveMode => $CategoryFrame
$e
JoinInner(l, e)
-
---ProduceDomainAlist(u,e) ==
--- -- Gives a complete Alist for all the functions in the Domain
--- not (sig:= get(u,"modemap",e)) => nil
--- sig:= CADAAR sig
--- --an incantation
--- [c,.,.]:= compMakeCategoryObject(sig,e)
--- -- We assume that the environment need not be kept
--- c.1