aboutsummaryrefslogtreecommitdiff
path: root/src/interp/i-coerce.boot
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-02-24 03:14:35 +0000
committerdos-reis <gdr@axiomatics.org>2011-02-24 03:14:35 +0000
commit7eca3ee736c49024a85ad00ff9b0a912d640380c (patch)
tree3ac6fb675cb2efbf8c4a62dfa9ca069de6aeb234 /src/interp/i-coerce.boot
parent155d5c8bf8562bc3797535df1cbb89f7dcb5c03d (diff)
downloadopen-axiom-7eca3ee736c49024a85ad00ff9b0a912d640380c.tar.gz
some cleanups
Diffstat (limited to 'src/interp/i-coerce.boot')
-rw-r--r--src/interp/i-coerce.boot26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/interp/i-coerce.boot b/src/interp/i-coerce.boot
index b20c951f..ae41e1f9 100644
--- a/src/interp/i-coerce.boot
+++ b/src/interp/i-coerce.boot
@@ -340,19 +340,19 @@ getConstantFromDomain(form,domainForm) ==
SPADCALL compiledLookupCheck(key,sig,domain)
-domainOne(domain) == getConstantFromDomain('(One),domain)
+domainOne(domain) == getConstantFromDomain($One,domain)
-domainZero(domain) == getConstantFromDomain('(Zero),domain)
+domainZero(domain) == getConstantFromDomain($Zero,domain)
equalOne(object, domain) ==
-- tries using constant One and "=" from domain
-- object should not be wrapped
- algEqual(object, getConstantFromDomain('(One),domain), domain)
+ algEqual(object, getConstantFromDomain($One,domain), domain)
equalZero(object, domain) ==
-- tries using constant Zero and "=" from domain
-- object should not be wrapped
- algEqual(object, getConstantFromDomain('(Zero),domain), domain)
+ algEqual(object, getConstantFromDomain($Zero,domain), domain)
algEqual(object1, object2, domain) ==
-- sees if 2 objects of the same domain are equal by using the
@@ -443,9 +443,9 @@ canCoerce1(t1,t2) ==
t1 is ['Segment, s1] and t2 is ['UniversalSegment, s2] and
(isEqualOrSubDomain(s1, s2) or canCoerce(s1, s2)) => true
- t1 is ['Tuple,S] and t2 ~= '(OutputForm) => canCoerce(['List, S], t2)
+ t1 is ['Tuple,S] and t2 ~= $OutputForm => canCoerce(['List, S], t2)
- isRingT2 := ofCategory(t2,'(Ring))
+ isRingT2 := ofCategory(t2,$Ring)
isRingT2 and isEqualOrSubDomain(t1,$Integer) => true
(ans := canCoerceTopMatching(t1,t2,nt1,nt2)) ~= 'maybe => ans
t2 = $Integer => canCoerceLocal(t1,t2) -- is true
@@ -782,7 +782,7 @@ coerceInt0(triple,t2) ==
s1 := equiType(t1)
s2 := equiType(t2)
s1 = s2 => return objNew(val,t2)
- -- t1 is ['Mapping,:.] and t2 ~= '(Any) => NIL
+ -- t1 is ['Mapping,:.] and t2 ~= $Any => NIL
-- note: may be able to coerce TO mapping
-- treat Exit like Any
-- handle case where we must generate code
@@ -955,12 +955,12 @@ coerceIntAlgebraicConstant(object,t2) ==
-- should use = from domain, but have to check on defaults code
t1 := objMode object
val := objValUnwrap object
- ofCategory(t1,'(Monoid)) and ofCategory(t2,'(Monoid)) and
- val = getConstantFromDomain('(One),t1) =>
- objNewWrap(getConstantFromDomain('(One),t2),t2)
- ofCategory(t1,'(AbelianMonoid)) and ofCategory(t2,'(AbelianMonoid)) and
- val = getConstantFromDomain('(Zero),t1) =>
- objNewWrap(getConstantFromDomain('(Zero),t2),t2)
+ ofCategory(t1,$Monoid) and ofCategory(t2,$Monoid) and
+ val = getConstantFromDomain($One,t1) =>
+ objNewWrap(getConstantFromDomain($One,t2),t2)
+ ofCategory(t1,$AbelianMonoid) and ofCategory(t2,$AbelianMonoid) and
+ val = getConstantFromDomain($Zero,t1) =>
+ objNewWrap(getConstantFromDomain($Zero,t2),t2)
NIL
++ returns true if `val' belongs to the Union branch guarded by `pred'.