aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2009-10-15 09:52:30 +0000
committerdos-reis <gdr@axiomatics.org>2009-10-15 09:52:30 +0000
commit4a8c82c52e9cf88d925c1de807307b6ec8d26c9b (patch)
treefb9e251e9773250eff3d9b83bf8c2477ec4202db /src/interp
parentba8c0daf0ca45c08bd5025f9dd67892132a16110 (diff)
downloadopen-axiom-4a8c82c52e9cf88d925c1de807307b6ec8d26c9b.tar.gz
* interp/buildom.boot: Tidy.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/buildom.boot25
-rw-r--r--src/interp/i-funsel.boot3
2 files changed, 19 insertions, 9 deletions
diff --git a/src/interp/buildom.boot b/src/interp/buildom.boot
index 65beaa4c..0aff103a 100644
--- a/src/interp/buildom.boot
+++ b/src/interp/buildom.boot
@@ -89,8 +89,9 @@ Record(:args) ==
dom.1 :=
["lookupInTable",dom,
[["=",[[$Boolean,"$","$"],:oldSlotCode nargs]],
- ["~=",[[$Boolean,"$","$"],:0]],
- ["coerce",[[$OutputForm,"$"],:oldSlotCode(nargs + 1)]]]]
+ ["~=",[[$Boolean,"$","$"],:0]],
+ ["hash",[[$SingleInteger,"$"],:0]],
+ ["coerce",[[$OutputForm,"$"],:oldSlotCode(nargs + 1)]]]]
dom.2 := NIL
dom.3 := ["RecordCategory",:QCDR dom.0]
dom.4 := [$commonCategoryDefaults, $commonCategoryAncestors]
@@ -164,7 +165,8 @@ Union(:args) ==
["lookupInTable",dom,
[["=",[[$Boolean,"$","$"],:oldSlotCode nargs]],
["~=",[[$Boolean,"$","$"],:0]],
- ["coerce",[[$OutputForm,"$"],:oldSlotCode (nargs+1)]]]]
+ ["hash", [[$SingleInteger,"$"],:0]],
+ ["coerce",[[$OutputForm,"$"],:oldSlotCode (nargs+1)]]]]
dom.2 := NIL
dom.3 := ["UnionCategory",:QCDR dom.0]
dom.4 := [$commonCategoryDefaults, $commonCategoryAncestors]
@@ -219,7 +221,8 @@ Mapping(:args) ==
["lookupInTable",dom,
[["=",[[$Boolean,"$","$"],:oldSlotCode nargs]],
["~=",[[$Boolean,"$","$"],:0]],
- ["coerce",[[$OutputForm,"$"],:oldSlotCode(nargs + 1)]]]]
+ ["hash", [[$SingleInteger,"$"],:0]],
+ ["coerce",[[$OutputForm,"$"],:oldSlotCode(nargs + 1)]]]]
dom.2 := NIL
dom.3 := '(SetCategory)
dom.4 := [$commonCategoryDefaults, $commonCategoryAncestors]
@@ -254,9 +257,10 @@ Enumeration(:"args") ==
["lookupInTable",dom,
[["=",[[$Boolean,"$","$"],:oldSlotCode nargs]],
["~=",[[$Boolean,"$","$"],:0]],
- ["coerce",[[$OutputForm,"$"],:oldSlotCode(nargs+1)],
- [["$", $Symbol], :oldSlotCode(nargs+2)]]
- ]]
+ ["hash", [[$SingleInteger,"$"],:0]],
+ ["coerce",[[$OutputForm,"$"],:oldSlotCode(nargs+1)],
+ [["$", $Symbol], :oldSlotCode(nargs+2)]]
+ ]]
dom.2 := NIL
dom.3 := ["EnumerationCategory",:QCDR dom.0]
dom.4 := [$commonCategoryDefaults, $commonCategoryAncestors]
@@ -308,7 +312,9 @@ mkMappingFunList(nam,mapForm,e) ==
sigFunAlist:=
[["=",[$Boolean,nam ,nam], ["ELT",dc,$FirstParamSlot + nargs]],
["~=",[$Boolean,nam,nam],["ELT",dc,0]],
- ["coerce",[$OutputForm,nam], ["ELT",dc,$FirstParamSlot + nargs + 1]]]
+ ["hash",[$SingleInteger,nam],["ELT",dc,0]],
+ ["coerce",[$OutputForm,nam],
+ ["ELT",dc,$FirstParamSlot + nargs + 1]]]
[substitute(nam,dc,substituteDollarIfRepHack sigFunAlist),e]
mkRecordFunList(nam,["Record",:Alist],e) ==
@@ -318,6 +324,7 @@ mkRecordFunList(nam,["Record",:Alist],e) ==
[["construct",[nam,:[A for [.,a,A] in Alist]],"mkRecord"],
["=",[$Boolean,nam ,nam],["ELT",dc,$FirstParamSlot + len]],
["~=",[$Boolean,nam,nam],["ELT",dc,0]],
+ ["hash",[$SingleInteger,nam],["ELT",dc,0]],
["coerce",[$OutputForm,nam],["ELT",dc,$FirstParamSlot+len+1]],:
[["elt",[A,nam,PNAME a],["XLAM",["$1","$2"],["RECORDELT","$1",i,len]]]
for i in 0.. for [.,a,A] in Alist],:
@@ -336,6 +343,7 @@ mkNewUnionFunList(name,form is ["Union",:listOfEntries],e) ==
cList:=
[["=",[$Boolean,name ,name],["ELT",dc,$FirstParamSlot+nargs]],
["~=",[$Boolean,name,name],["ELT",dc,0]],
+ ["hash",[$SingleInteger,name],["ELT",dc,0]],
["coerce",[$OutputForm,name],["ELT",dc,$FirstParamSlot+nargs+1]],:
("append"/
[[["construct",[name,type],["XLAM",["#1"],["CONS",i,"#1"]]],
@@ -373,6 +381,7 @@ mkUnionFunList(op,form is ["Union",:listOfEntries],e) ==
cList:=
[["=",[$Boolean,g ,g],["ELT",op,$FirstParamSlot + nargs]],
["~=",[$Boolean,g,g],["ELT",op,0]],
+ ["hash",[$SingleInteger,g],["ELT",op,0]],
["coerce",[$OutputForm,g],["ELT",op,$FirstParamSlot+nargs+1]],:
("append"/
[[["autoCoerce",[g,t],upFun],
diff --git a/src/interp/i-funsel.boot b/src/interp/i-funsel.boot
index 069c37a8..68c93033 100644
--- a/src/interp/i-funsel.boot
+++ b/src/interp/i-funsel.boot
@@ -890,7 +890,8 @@ findFunctionInCategory(op,dc,tar,args1,args2,$Coerce,$SubDom) ==
if CONSP(xargs) then maxargs := MAX(maxargs,#xargs)
else maxargs := MAX(maxargs,1)
impls := cons([b,nil,true,d],impls)
- impls := cons([b,d,true,d],impls)
+ d isnt [k,"$",n] => systemErrorHere ["findFunctionInCategory",d]
+ impls := [[b,n,true,k],:impls]
impls := nreverse impls
if maxargs ~= -1 then
SL:= NIL