aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog10
-rw-r--r--src/interp/category.boot18
-rw-r--r--src/interp/define.boot1
-rw-r--r--src/interp/functor.boot13
-rw-r--r--src/interp/g-opt.boot1
5 files changed, 25 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 716a15e7..fb0ec9dc 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,13 @@
+2008-12-01 Gabriel Dos Reis <gdr@cs.tamu.edu>
+
+ * 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.
+
2008-11-30 Gabriel Dos Reis <gdr@cs.tamu.edu>
* interp/parse.boot (parseEquivalence): Remove.
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)) =>