diff options
author | dos-reis <gdr@axiomatics.org> | 2008-12-01 08:13:31 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2008-12-01 08:13:31 +0000 |
commit | 4bd99bf416b826b7cc94bc2b2290b0b540a30bae (patch) | |
tree | f1e2093a1899c2cfe25f8010ffbbcad9252d7b95 /src/interp | |
parent | c3b50d06f5f3be949d42619a014e4744853db68a (diff) | |
download | open-axiom-4bd99bf416b826b7cc94bc2b2290b0b540a30bae.tar.gz |
* interp/define.boot (compile): Don't check for PAC names.
* interp/g-opt.boot (optCall): Likewise.
* interp/functor.boot (SetFunctionSlots): Likewise.
(mkOperatorEntry): Lose first parameter.
(optPackageCall): Remove.
* interp/category.boot (mkCategory): Document. Adjust call to
mkOperatorEntry.
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/category.boot | 18 | ||||
-rw-r--r-- | src/interp/define.boot | 1 | ||||
-rw-r--r-- | src/interp/functor.boot | 13 | ||||
-rw-r--r-- | src/interp/g-opt.boot | 1 |
4 files changed, 15 insertions, 18 deletions
diff --git a/src/interp/category.boot b/src/interp/category.boot index c7d49b9c..91a79604 100644 --- a/src/interp/category.boot +++ b/src/interp/category.boot @@ -82,21 +82,26 @@ CategoryPrint(D,$e) == ++ Returns a fresly built category object for a domain or package ++ (as indicated by `domainOrPackage'), with signature list -++ designated by `sigList', attribute list designated by `attList, -++ domain list designatured by `domList', and a princical ancestor +++ designated by `sigList', attribute list designated by `attList', +++ used domains list designated by `domList', and a princical ancestor ++ category object designated by `PrincipalAncestor'. mkCategory: (%Symbol,%List,%List,%List, %Maybe %Shell) -> %Shell mkCategory(domainOrPackage,sigList,attList,domList,PrincipalAncestor) == NSigList := nil - if PrincipalAncestor=nil then count := 6 - else count := #PrincipalAncestor + -- Unless extending a principal ancestor (from the end), start + -- from the first free, unencumbered slot. + count := + PrincipalAncestor = nil => $NRTbase + #PrincipalAncestor sigList:= [if s is [sig,pred] then + -- Don't retain duplicate signatures. + -- ??? Should we not check for predicate subsumption too? or/[x is [[ =sig,.,:impl],:num] for x in NSigList] => [sig,pred,:impl] --only needed for multiple copies of sig num:= if domainOrPackage="domain" then count else count-5 - nsig:= mkOperatorEntry("domain",sig,pred,num) + nsig:= mkOperatorEntry(sig,pred,num) NSigList:= [[nsig,:count],:NSigList] count:= count+1 nsig @@ -119,12 +124,15 @@ mkCategory(domainOrPackage,sigList,attList,domList,PrincipalAncestor) == v is ["Record",.,:w] => "union"/[Prepare2 third x for x in w] [v] OldLocals:= nil + -- Remove possible duplicate local domain caches. if PrincipalAncestor then for u in (OldLocals:= third PrincipalAncestor.4) repeat NewLocals := delete(first u,NewLocals) + -- New local domains caches are hosted in slots at the end onward for u in NewLocals repeat OldLocals := [[u,:count],:OldLocals] count := count+1 + -- Build a fresh category object stuffed with all updated information v := newShell count v.0 := nil v.1 := sigList diff --git a/src/interp/define.boot b/src/interp/define.boot index 8e684640..6225e63b 100644 --- a/src/interp/define.boot +++ b/src/interp/define.boot @@ -1247,7 +1247,6 @@ compile u == INTERN STRCONC(encodeItem $prefix,'";",encodeItem op) isPackageFunction() and KAR $functorForm^="CategoryDefaults" => if null opmodes then userError ['"no modemap for ",op] - opmodes is [['PAC,.,name]] => name encodeFunctionName(op,$functorForm,$signatureOfForm,";",$suffix) encodeFunctionName(op,$functorForm,$signatureOfForm,";",$suffix) where diff --git a/src/interp/functor.boot b/src/interp/functor.boot index 2e0e7a4d..e31d5399 100644 --- a/src/interp/functor.boot +++ b/src/interp/functor.boot @@ -712,8 +712,7 @@ SetFunctionSlots(sig,body,flag,mode) == --mode is either "original" or "adding" else body:= SetFunctionSlots(truename,body,nil,mode) else nil else - if not (catImplem is ['PAC,:.]) then - keyedSystemError("S2OR0002",[catImplem]) + keyedSystemError("S2OR0002",[catImplem]) body is ["setShellEntry",:.] => body body is ['SETELT,:.] => systemErrorHere "SetFunctionSlots" body is ['QSETREFV,:.] => systemErrorHere "SetFunctionSlots" @@ -997,19 +996,11 @@ isCategoryPackageName nam == p := PNAME opOf nam p.(MAXINDEX p) = char '_& -mkOperatorEntry(domainOrPackage,opSig is [op,sig,:flag],pred,count) == - domainOrPackage^="domain" => - [opSig,pred,["PAC","$",name]] where - name() == encodeFunctionName(op,domainOrPackage,sig,":",count) +mkOperatorEntry(opSig is [op,sig,:flag],pred,count) == null flag => [opSig,pred,["ELT","$",count]] first flag="constant" => [[op,sig],pred,["CONST","$",count]] systemError ["unknown variable mode: ",flag] -optPackageCall(x,["PAC",packageVariableOrForm,functionName],arglist) == - RPLACA(x,functionName) - RPLACD(x,[:arglist,packageVariableOrForm]) - x - --% Code for encoding function names inside package or domain encodeFunctionName(fun,package is [packageName,:arglist],signature,sep,count) diff --git a/src/interp/g-opt.boot b/src/interp/g-opt.boot index 2a67c9c4..63f99d40 100644 --- a/src/interp/g-opt.boot +++ b/src/interp/g-opt.boot @@ -144,7 +144,6 @@ optCall (x is ["call",:u]) == atom first x => first x [fn,:a]:= first x atom fn => (RPLAC(rest x,a); RPLAC(first x,fn)) - fn is ["PAC",:.] => optPackageCall(x,fn,a) fn is ["applyFun",name] => (RPLAC(first x,"SPADCALL"); RPLAC(rest x,[:a,name]); x) fn is [q,R,n] and MEMQ(q,'(getShellEntry ELT QREFELT CONST)) => |