diff options
author | dos-reis <gdr@axiomatics.org> | 2011-12-03 20:03:11 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2011-12-03 20:03:11 +0000 |
commit | 9b81bd9f34147232eb8e6c56978e36f49f8f6771 (patch) | |
tree | 1e6a109bc4344fc380e7efa4ae0f520629da5f36 /src/interp | |
parent | b2848762b8155be597dfa4819f8ff5ea337e3e4b (diff) | |
download | open-axiom-9b81bd9f34147232eb8e6c56978e36f49f8f6771.tar.gz |
* interp/compiler.boot (setqMultiple): Handle lhs and rhs of type
Cross instance.
* interp/g-util.boot ($DomainNames): Include Cross.
* interp/cattable.boot (genCategoryTable): Do not eval Cross.
It is bogus to prepopulate the table with builtin functors anyway.
* algebra/triset.spad.pamphlet
(PolynomialSetUtilitiesPackage)[removeRedundantFactors]: Do not
define `c' and `d' in conditional. Make the initializer conditional.
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/cattable.boot | 2 | ||||
-rw-r--r-- | src/interp/compiler.boot | 18 | ||||
-rw-r--r-- | src/interp/g-util.boot | 3 |
3 files changed, 17 insertions, 6 deletions
diff --git a/src/interp/cattable.boot b/src/interp/cattable.boot index 4cd1d444..c56c9c17 100644 --- a/src/interp/cattable.boot +++ b/src/interp/cattable.boot @@ -66,7 +66,7 @@ genCategoryTable() == -- $nonLisplibDomains, $noCategoryDomains are set in BUILDOM BOOT specialDs := setDifference($nonLisplibDomains,$noCategoryDomains) domainTable:= [:[addDomainToTable(id, getConstrCat eval([id]).3) - for id in specialDs], :domainTable] + for id in specialDs | id ~= 'Cross], :domainTable] for [id,:entry] in domainTable repeat for [a,:b] in encodeCategoryAlist(id,entry) repeat tableValue(_*HASCATEGORY_-HASH_*,[id,:a]) := b diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index d1a58bd3..140d2362 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -974,12 +974,22 @@ setqMultiple(nameList,val,m,e) == T:= [.,m1,.]:= compSetq1(g,val,$EmptyMode,e) or return nil e:= put(g,"mode",m1,e) [x,m',e]:= coerce(T,m) or return nil - -- 1.1. exit if result is a list + -- 2. exit if result is a list m1 is ["List",D] => for y in nameList repeat e:= giveVariableSomeValue(y,D,e) coerce([["PROGN",x,["%LET",nameList,g],g],m',e],m) - -- 2. verify that the #nameList = number of parts of right-hand-side + -- 3. For a cross, do it by hand here instead of general mm. FIXME. + m1 is ['Cross,:.] => + n := #m1.args + #nameList ~= n => + stackMessage('"%1b must decompose into %2 components",[val,n]) + stmts := nil + for y in nameList for t in m1.args for i in 0.. repeat + e := giveVariableSomeValue(y,t,e) + stmts := [['%LET,y,['%call,eltRecordFun(n,i),g,i]],:stmts] + coerce([['PROGN,x,:reverse! stmts,g],m1,e],m) + -- 4. verify that the #nameList = number of parts of right-hand-side selectorModePairs:= --list of modes decompose(m1,#nameList,e) or return nil where @@ -990,7 +1000,7 @@ setqMultiple(nameList,val,m,e) == stackMessage('"no multiple assigns to mode: %1p",[t]) #nameList~=#selectorModePairs => stackMessage('"%1b must decompose into %2 components",[val,#nameList]) - -- 3. generate code; return + -- 5. generate code; return assignList:= [([.,.,e]:= compSetq1(x,["elt",g,y],z,e) or return "failed").expr for x in nameList for [y,:z] in selectorModePairs] @@ -1956,7 +1966,7 @@ compComma(form,m,e) == Tl' := [coerce(T,t) or return "failed" for T in Tl] Tl' = "failed" => nil [["asTupleNew0", ["getVMType",t], [T.expr for T in Tl']], m, e] - T := [['%vector, :[T.expr for T in Tl]], + T := [['%call,mkRecordFun #argl,:[T.expr for T in Tl]], ["Cross",:[T.mode for T in Tl]], e] coerce(T,m) diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot index 8a3254ac..c305a9bf 100644 --- a/src/interp/g-util.boot +++ b/src/interp/g-util.boot @@ -93,7 +93,8 @@ $DomainNames == SubDomain _ Union _ Record _ - Enumeration) + Enumeration _ + Cross) macro builtinFunctorName? x == symbolMember?(x,$DomainNames) |