diff options
author | dos-reis <gdr@axiomatics.org> | 2009-08-14 10:48:09 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2009-08-14 10:48:09 +0000 |
commit | d2afe2366c2c592327cd0eb6593a3536a6eff54d (patch) | |
tree | 11438ab261e17b8ccdd1f91ba83bb3b93032ec5e /src/interp/i-coerce.boot | |
parent | 9bcc210fb444e41fc45e6ccd9ef2be197337d3e8 (diff) | |
download | open-axiom-d2afe2366c2c592327cd0eb6593a3536a6eff54d.tar.gz |
* boot/tokens.boot: Retire "^=". Introduce "~=".
* boot/ast.boot: Use "~=" instead of "^=".
* boot/includer.boot: Likewise.
* boot/translator.boot: Likewise.
* interp/as.boot: Likewise.
* interp/bc-misc.boot: Likewise.
* interp/bc-solve.boot: Likewise.
* interp/bc-util.boot: Likewise.
* interp/br-con.boot: Likewise.
* interp/br-data.boot: Likewise.
* interp/br-op1.boot: Likewise.
* interp/br-op2.boot: Likewise.
* interp/br-prof.boot: Likewise.
* interp/br-saturn.boot: Likewise.
* interp/br-search.boot: Likewise.
* interp/br-util.boot: Likewise.
* interp/c-doc.boot: Likewise.
* interp/c-util.boot: Likewise.
* interp/category.boot: Likewise.
* interp/cattable.boot: Likewise.
* interp/clam.boot: Likewise.
* interp/clammed.boot: Likewise.
* interp/compiler.boot: Likewise.
* interp/database.boot: Likewise.
* interp/define.boot: Likewise.
* interp/format.boot: Likewise.
* interp/fortcall.boot: Likewise.
* interp/functor.boot: Likewise.
* interp/g-cndata.boot: Likewise.
* interp/g-opt.boot: Likewise.
* interp/g-timer.boot: Likewise.
* interp/g-util.boot: Likewise.
* interp/guess.boot: Likewise.
* interp/ht-root.boot: Likewise.
* interp/ht-util.boot: Likewise.
* interp/htsetvar.boot: Likewise.
* interp/i-analy.boot: Likewise.
* interp/i-code.boot: Likewise.
* interp/i-coerce.boot: Likewise.
* interp/i-coerfn.boot: Likewise.
* interp/i-eval.boot: Likewise.
* interp/i-funsel.boot: Likewise.
* interp/i-intern.boot: Likewise.
* interp/i-map.boot: Likewise.
* interp/i-output.boot: Likewise.
* interp/i-resolv.boot: Likewise.
* interp/i-spec1.boot: Likewise.
* interp/i-spec2.boot: Likewise.
* interp/i-syscmd.boot: Likewise.
* interp/i-toplev.boot: Likewise.
* interp/i-util.boot: Likewise.
* interp/int-top.boot: Likewise.
* interp/interop.boot: Likewise.
* interp/intfile.boot: Likewise.
* interp/lisplib.boot: Likewise.
* interp/macex.boot: Likewise.
* interp/mark.boot: Likewise.
* interp/match.boot: Likewise.
* interp/modemap.boot: Likewise.
* interp/msg.boot: Likewise.
* interp/msgdb.boot: Likewise.
* interp/newfort.boot: Likewise.
* interp/nruncomp.boot: Likewise.
* interp/nrunfast.boot: Likewise.
* interp/nrungo.boot: Likewise.
* interp/nrunopt.boot: Likewise.
* interp/parse.boot: Likewise.
* interp/pathname.boot: Likewise.
* interp/pf2atree.boot: Likewise.
* interp/pf2sex.boot: Likewise.
* interp/postpar.boot: Likewise.
* interp/profile.boot: Likewise.
* interp/pspad1.boot: Likewise.
* interp/pspad2.boot: Likewise.
* interp/record.boot: Likewise.
* interp/scan.boot: Likewise.
* interp/setvars.boot: Likewise.
* interp/simpbool.boot: Likewise.
* interp/slam.boot: Likewise.
* interp/topics.boot: Likewise.
* interp/trace.boot: Likewise.
* interp/wi1.boot: Likewise.
* interp/wi2.boot: Likewise.
* interp/word.boot: Likewise.
Diffstat (limited to 'src/interp/i-coerce.boot')
-rw-r--r-- | src/interp/i-coerce.boot | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/src/interp/i-coerce.boot b/src/interp/i-coerce.boot index a46711e0..663b1178 100644 --- a/src/interp/i-coerce.boot +++ b/src/interp/i-coerce.boot @@ -119,7 +119,7 @@ retract1 object == -- try to retract the "coefficients" -- think of P RN -> P I or M RN -> M I object' := retractUnderDomain(object,type,underDomain) - object' ^= 'failed => object' + object' ~= 'failed => object' -- see if we can use the retract functions (object' := coerceRetract(object,underDomain)) => object' -- see if we have a special case here @@ -129,8 +129,8 @@ retract1 object == retractUnderDomain(object,type,underDomain) == null (ud := underDomainOf underDomain) => 'failed [c,:args] := deconstructT type - 1 ^= #args => 'failed - 1 ^= #c => 'failed + 1 ~= #args => 'failed + 1 ~= #c => 'failed type'' := constructT(c,[ud]) (object' := coerceInt(object,type'')) => object' 'failed @@ -224,8 +224,8 @@ retract2Specialization object == -- try to retract as an element of rep and see if we can get an -- element of k val' := retract objNew(val,rep) - while (val' ^= 'failed) and - (equiType(objMode val') ^= k) repeat + while (val' ~= 'failed) and + (equiType(objMode val') ~= k) repeat val' := retract val' val' = 'failed => NIL val' @@ -443,11 +443,11 @@ 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 and isEqualOrSubDomain(t1,$Integer) => true - (ans := canCoerceTopMatching(t1,t2,nt1,nt2)) ^= 'maybe => ans + (ans := canCoerceTopMatching(t1,t2,nt1,nt2)) ~= 'maybe => ans t2 = $Integer => canCoerceLocal(t1,t2) -- is true ans := canCoerceTower(t1,t2) or [.,:arg]:= deconstructT t2 @@ -498,7 +498,7 @@ canCoerceTopMatching(t1,t2,tt1,tt2) == 1 = #u2 => NIL u1 := deconstructT t1 1 = #u1 => NIL -- no under domain - first(u1) ^= first(u2) => 'maybe + first(u1) ~= first(u2) => 'maybe canCoerce(underDomainOf t1, underDomainOf t2) canCoerceExplicit2Mapping(t1,t is ['Mapping,target,:argl]) == @@ -561,7 +561,7 @@ canCoerceByMap(t1,t2) == 1 = #u2 => NIL u1 := deconstructT t1 1 = #u1 => NIL -- no under domain - CAR(u1) ^= CAR(u2) => NIL + CAR(u1) ~= CAR(u2) => NIL top := CAAR u1 u1 := underDomainOf t1 u2 := underDomainOf t2 @@ -610,7 +610,7 @@ canCoerceLocal(t1,t2) == tag='total => true (functionp(fun) and (v:=CATCH('coerceFailure,FUNCALL(fun,'_$fromCoerceable_$,t1,t2))) - and v ^= $coerceFailure) or canCoerceByFunction(t1,t2) + and v ~= $coerceFailure) or canCoerceByFunction(t1,t2) canCoerceByFunction(t1,t2) canCoerceCommute(t1,t2) == @@ -675,10 +675,10 @@ absolutelyCanCoerceByCheating(t1,t2) == [tl1,:u1] := deconstructT t1 [tl2,:u2] := deconstructT t2 tl1 = '(Stream) and tl2 = '(InfiniteTuple) => - #u1 ^= #u2 => false + #u1 ~= #u2 => false "and"/[absolutelyCanCoerceByCheating(x1,x2) for x1 in u1 for x2 in u2] - tl1 ^= tl2 => false - #u1 ^= #u2 => false + tl1 ~= tl2 => false + #u1 ~= #u2 => false "and"/[absolutelyCanCoerceByCheating(x1,x2) for x1 in u1 for x2 in u2] absolutelyCannotCoerce(t1,t2) == @@ -727,7 +727,7 @@ absolutelyCannotCoerce(t1,t2) == 1 = #v2 => NIL v1 := deconstructT t1 1 = #v1 => NIL - CAR(v1) ^= CAR(v2) => NIL + CAR(v1) ~= CAR(v2) => NIL absolutelyCannotCoerce(u1,u2) typeIsASmallInteger x == (x = $SingleInteger) @@ -782,14 +782,14 @@ 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 null(isWrapped val) and (t1 isnt ['FunctionCalled,:.] or not $genValue)=> intCodeGenCOERCE(triple,t2) - t1 = $Any and t2 ^= $OutputForm and ([t1',:val'] := unwrap val) and + t1 = $Any and t2 ~= $OutputForm and ([t1',:val'] := unwrap val) and (ans := coerceInt0(objNewWrap(val',t1'),t2)) => ans if not EQ(s1,t1) then triple := objNew(val,s1) x := coerceInt(triple,s2) => @@ -831,7 +831,7 @@ coerceInt1(triple,t2) == t2 = $Void => objNew(voidValue(),$Void) t2 = $Any => objNewWrap([t1,:unwrap val],$Any) - t1 = $Any and t2 ^= $OutputForm and ([t1',:val'] := unwrap val) and + t1 = $Any and t2 ~= $OutputForm and ([t1',:val'] := unwrap val) and (ans := coerceInt(objNewWrap(val',t1'),t2)) => ans -- next is for tagged union selectors for the time being @@ -860,7 +860,7 @@ coerceInt1(triple,t2) == atom vars => [vars] vars is ["tuple",:.] => rest vars vars - #margl ^= #vars => 'continue + #margl ~= #vars => 'continue tree := mkAtree ['ADEF,vars,[target,:margl],[NIL for x in rest t2],:body] CATCH('coerceOrCroaker, bottomUp tree) = 'croaked => nil return getValue tree @@ -868,7 +868,7 @@ coerceInt1(triple,t2) == (t1 = $Symbol) and (t2 is ['Mapping,target,:margl]) => null (mms := selectMms1(unwrap val,nil,margl,margl,target)) => NIL [dc,targ,:argl] := CAAR mms - targ ^= target => NIL + targ ~= target => NIL $genValue => fun := getFunctionFromDomain(unwrap val,dc,argl) objNewWrap(fun,t2) @@ -878,7 +878,7 @@ coerceInt1(triple,t2) == null (mms := selectMms1(sym,target,margl,margl,NIL)) => null (mms := selectMms1(sym,target,margl,margl,true)) => NIL [dc,targ,:argl] := CAAR mms - targ ^= target => NIL + targ ~= target => NIL dc is ["__FreeFunction__",:freeFun] => objNew( freeFun, t2 ) $genValue => objNewWrap( getFunctionFromDomain(sym,dc,argl), t2 ) val := NRTcompileEvalForm(sym, CDR CAAR mms, evalDomain dc) @@ -888,7 +888,7 @@ coerceInt1(triple,t2) == transferPropsToNode(sym,symNode) null (mms := selectLocalMms(symNode,sym,margl,target)) => NIL [dc,targ,:argl] := CAAR mms - targ ^= target => NIL + targ ~= target => NIL ml := [target,:margl] intName := or/[mm for mm in mms | (mm is [[., :ml1],oldName,:.] @@ -1026,9 +1026,9 @@ coerceIntByMap(triple,t2) == 1 = #u2 => NIL -- no under domain u1 := deconstructT t1 1 = #u1 => NIL - CAAR u1 ^= CAAR u2 => nil -- constructors not equal + CAAR u1 ~= CAAR u2 => nil -- constructors not equal ^valueArgsEqual?(t1, t2) => NIL --- CAR u1 ^= CAR u2 => NIL +-- CAR u1 ~= CAR u2 => NIL top := CAAR u1 u1 := underDomainOf t1 u2 := underDomainOf t2 @@ -1208,7 +1208,7 @@ computeTTTranspositions(t1,t2) == p2' := MSORT p2 p2 = p2' => NIL -- if anything is repeated twice, leave - p2' ^= MSORT REMDUP p2' => NIL + p2' ~= MSORT REMDUP p2' => NIL -- create a list of permutations that transform the tower parts -- of t1 into the order they are in in t2 n1 := #tl1 @@ -1229,7 +1229,7 @@ computeTTTranspositions(t1,t2) == tower.(CDR perm) := t towers := CONS(VEC2LIST tower,towers) towers := [reassembleTowerIntoType tower for tower in towers] - if CAR(towers) ^= t2 then towers := cons(t2,towers) + if CAR(towers) ~= t2 then towers := cons(t2,towers) NREVERSE towers decomposeTypeIntoTower t == @@ -1260,7 +1260,7 @@ permuteToOrder(p,n,start) == for i in start+1..n while not stpos repeat if p.i = start then stpos := i perms := NIL - while stpos ^= start repeat + while stpos ~= start repeat x := stpos - 1 perms := [[x,:stpos],:perms] t := p.stpos @@ -1348,7 +1348,7 @@ coerceByFunction(T,m2) == -- try going back to types like RN instead of QF I m1' := eqType m1 m2' := eqType m2 - (m1 ^= m1') or (m2 ^= m2') => coerceByFunction(objNew(x,m1'),m2') + (m1 ~= m1') or (m2 ~= m2') => coerceByFunction(objNew(x,m1'),m2') NIL hasCorrectTarget(m,sig is [dc,tar,:.]) == |