diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 6 | ||||
-rw-r--r-- | src/interp/c-util.boot | 4 | ||||
-rw-r--r-- | src/interp/category.boot | 24 | ||||
-rw-r--r-- | src/interp/modemap.boot | 4 |
4 files changed, 20 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 93f7a46c..5619b63d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2011-08-18 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/c-util.boot: Use category accessors. + * interp/category.boot: Likewise. + * interp/modemap.boot: Likewise. + +2011-08-18 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/c-util.boot (categoryAssociatedTypes): Rename from categoryHierarchy. Adjust callers. (categoryPrincipals): New. diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot index 54000fad..24a3a041 100644 --- a/src/interp/c-util.boot +++ b/src/interp/c-util.boot @@ -1035,8 +1035,8 @@ extendsCategoryForm(domain,form,form') == assoc(substitute(domain,"$",[op,args]), substitute(domain,"$",categoryExports formVec)) form' is ["ATTRIBUTE",at] => - assoc(at,formVec.2) or - assoc(substitute(domain,"$",at),substitute(domain,"$",formVec.2)) + assoc(at,categoryAttributes formVec) or + assoc(substitute(domain,"$",at),substitute(domain,"$",categoryAttributes formVec)) form' is ["IF",:.] => true --temporary hack so comp won't fail -- Are we dealing with an Aldor category? If so use the "has" function ... # formVec = 1 => newHasTest(form,form') diff --git a/src/interp/category.boot b/src/interp/category.boot index c942e5c2..e73cccd9 100644 --- a/src/interp/category.boot +++ b/src/interp/category.boot @@ -365,7 +365,7 @@ DescendantP(a,b) == a is ["SIGNATURE",:.] => false a:= CatEval a b is ["ATTRIBUTE",b'] => - (l:=assoc(b',a.2)) => TruthP second l + (l := assoc(b',categoryAttributes a)) => TruthP second l listMember?(b,categoryPrincipals a) => true AncestorP(b,[first u for u in categoryAncestors a]) => true false @@ -376,7 +376,7 @@ JoinInner(l,$e) == $NewCatVec: local := nil CondList:= nil for u in l repeat - for at in u.2 repeat + for at in categoryAttributes u repeat at2:= first at if at2 isnt [.,:.] then at2 := [at2] -- the variable $Attributes is built globally, so that true @@ -403,8 +403,8 @@ JoinInner(l,$e) == -- This is a list of all the categories that this extends -- conditionally or unconditionally sigl := categoryExports $NewCatVec - attl:= $NewCatVec.2 - globalDomains:= $NewCatVec.5 + attl := categoryAttributes $NewCatVec + globalDomains := categoryParameters $NewCatVec FundamentalAncestors := categoryAncestors $NewCatVec if $NewCatVec.0 then FundamentalAncestors:= [[$NewCatVec.0],:FundamentalAncestors] @@ -462,7 +462,7 @@ JoinInner(l,$e) == reallynew:= nil objectMember?(b,l) => --objectMember? since category vectors are guaranteed unique - (sigl:= categoryExports $NewCatVec; attl:= $NewCatVec.2; l:= remove(l,b)) + (sigl:= categoryExports $NewCatVec; attl:= categoryAttributes $NewCatVec; l:= remove(l,b)) -- SAY("domain ",bname," subsumes") -- SAY("adding a conditional domain ", -- bname, @@ -472,14 +472,14 @@ JoinInner(l,$e) == CondList := remove(CondList,bCond) -- value of bCond not used and could be nil -- bCond:= second bCond - globalDomains:= $NewCatVec.5 + globalDomains := categoryParameters $NewCatVec for u in categoryExports $NewCatVec repeat if not listMember?(u,sigl) then [s,c,i]:= u if c=true then sigl:= [[s,condition,i],:sigl] else sigl:= [[s,["and",condition,c],i],:sigl] - for u in $NewCatVec.2 repeat + for u in categoryAttributes $NewCatVec repeat if not listMember?(u,attl) then [a,c]:= u if c=true @@ -503,15 +503,11 @@ JoinInner(l,$e) == -- performing Operator Subsumption for b in l repeat sigl:= SigListUnion([DropImplementations u for u in categoryExports b],sigl) - attl:= --- next two lines are merely performance improvements - symbolMember?(attl,b.2) => b.2 - symbolMember?(b.2,attl) => attl - S_+(b.2,attl) - globalDomains:= [:globalDomains,:S_-(b.5,globalDomains)] + attl := S_+(categoryAttributes b,attl) + globalDomains:= [:globalDomains,:S_-(categoryParameters b,globalDomains)] for b in CondList repeat newpred:= second b - for u in (first b).2 repeat + for u in categoryAttributes first b repeat v:= assoc(first u,attl) null v => attl:= diff --git a/src/interp/modemap.boot b/src/interp/modemap.boot index cff85592..4b7b2c13 100644 --- a/src/interp/modemap.boot +++ b/src/interp/modemap.boot @@ -456,8 +456,8 @@ knownInfo pred == stackAndThrow('"can't find category of %1pb",[name]) [vv,.,.] := compMakeCategoryObject(v.mode,$e) or return stackAndThrow('"can't make category of %1pb",[name]) - listMember?(attr,vv.2) => true - x := assoc(attr,vv.2) => knownInfo second x + listMember?(attr,categoryAttributes vv) => true + x := assoc(attr,categoryAttributes vv) => knownInfo second x --format is a list of two elements: information, predicate false pred is ["has",name,cat] => |