diff options
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/as.boot | 8 | ||||
-rw-r--r-- | src/interp/clammed.boot | 4 | ||||
-rw-r--r-- | src/interp/compiler.boot | 2 | ||||
-rw-r--r-- | src/interp/i-code.boot | 4 | ||||
-rw-r--r-- | src/interp/i-coerce.boot | 26 | ||||
-rw-r--r-- | src/interp/i-coerfn.boot | 26 | ||||
-rw-r--r-- | src/interp/i-funsel.boot | 28 | ||||
-rw-r--r-- | src/interp/i-output.boot | 12 | ||||
-rw-r--r-- | src/interp/i-resolv.boot | 26 | ||||
-rw-r--r-- | src/interp/i-spec1.boot | 6 | ||||
-rw-r--r-- | src/interp/i-spec2.boot | 4 | ||||
-rw-r--r-- | src/interp/i-toplev.boot | 2 | ||||
-rw-r--r-- | src/interp/pspad1.boot | 4 | ||||
-rw-r--r-- | src/interp/record.boot | 2 | ||||
-rw-r--r-- | src/interp/sys-constants.boot | 35 | ||||
-rw-r--r-- | src/interp/wi1.boot | 8 |
16 files changed, 105 insertions, 92 deletions
diff --git a/src/interp/as.boot b/src/interp/as.boot index b64de57f..0c167248 100644 --- a/src/interp/as.boot +++ b/src/interp/as.boot @@ -803,7 +803,7 @@ asySig1(u,name?,target?) == asyComma? fn => u := [asySig(x,name?) for x in r] target? => - null u => '(Void) + null u => $Void -- this implies a multiple value return, not currently supported -- in the interpreter ['Multi,:u] @@ -820,7 +820,7 @@ asySig1(u,name?,target?) == asySig1(typ, name?, target?) x is '(_%) => '(_$) [fn,:[asySig(x,name?) for x in r]] ---x = 'Type => '(Type) +--x = 'Type => $Type x = '_% => '_$ x @@ -857,7 +857,7 @@ asyType x == -- fn = 'Declare and r is [name,typ,:.] => typ x is '(_%) => '(_$) x ---x = 'Type => '(Type) +--x = 'Type => $Type x = '_% => '_$ x @@ -926,7 +926,7 @@ asyTypeUnit x == x is '(_%) => '(_$) [fn,:asyTypeUnitList r] GETL(x,"NILADIC") => [x] ---x = 'Type => '(Type) +--x = 'Type => $Type x = '_% => '_$ x diff --git a/src/interp/clammed.boot b/src/interp/clammed.boot index e19e03ba..9894f53b 100644 --- a/src/interp/clammed.boot +++ b/src/interp/clammed.boot @@ -100,7 +100,7 @@ isValidType form == form is [T1, [T2, :.]] and T1 = T2 and member(T1, badDoubles) => NIL form is [=$QuotientField,D] and not isPartialMode(D) and - ofCategory(D,'(Field)) => NIL + ofCategory(D,$Field) => NIL form is ['UnivariatePolynomial, x, ['UnivariatePolynomial, y, .]] and x=y => NIL form = '(Complex (AlgebraicNumber)) => NIL @@ -170,7 +170,7 @@ isLegitimateMode(t,hasPolyMode,polyVarList) == t is [T1, [T2, :.]] and T1 = T2 and member(T1, badDoubles) => false t is [=$QuotientField,D] and not isPartialMode(D) and - ofCategory(D,'(Field)) => false + ofCategory(D,$Field) => false t = '(Complex (AlgebraicNumber)) => false t := equiType t diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index f9e4256f..ea2becbf 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -1711,7 +1711,7 @@ coerceExtraHard(T is [x,m',e],m) == -- FIXME: really, we shouldn't. Codes relying on this are -- FIXME: inherently difficult to comprehend and likely broken. T' := autoCoerceByModemap(T,m) => T' - m' is ['Record,:.] and m = $Expression => + m' is ['Record,:.] and m = $OutputForm => [['coerceRe2E,x,['ELT,COPY m',0]],m,e] -- Domain instantiations are first class objects m = $Domain => diff --git a/src/interp/i-code.boot b/src/interp/i-code.boot index 8dc692df..6db15fe9 100644 --- a/src/interp/i-code.boot +++ b/src/interp/i-code.boot @@ -83,10 +83,10 @@ intCodeGenCOERCE(triple,t2) == absolutelyCanCoerceByCheating(t1,t2) => objNew(val,t2) -- specially handle coerce to Any - t2 = '(Any) => objNew(['CONS,MKQ t1,val],t2) + t2 = $Any => objNew(['CONS,MKQ t1,val],t2) -- optimize coerces from Any - (t1 = '(Any)) and (val is ['CONS,t1',val']) => + (t1 = $Any) and (val is ['CONS,t1',val']) => intCodeGenCOERCE(objNew(val',removeQuote t1'),t2) -- specially handle coerce from Equation to Boolean 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'. diff --git a/src/interp/i-coerfn.boot b/src/interp/i-coerfn.boot index 9d95a741..4ef7dc9f 100644 --- a/src/interp/i-coerfn.boot +++ b/src/interp/i-coerfn.boot @@ -294,7 +294,7 @@ Dmp2Up(u, source is [dmp,vl,S],target is [up,var,T]) == S1 := [dmp,vl',S] plusfunc:= getFunctionFromDomain('_+,T,[T,T]) - zero := getConstantFromDomain('(Zero),T) + zero := getConstantFromDomain($Zero,T) x := NIL pos:= POSN1(var,vl) for [e,:c] in u until not y repeat @@ -1261,7 +1261,7 @@ SUP2Up(u,source is [.,S],target is [.,x,T]) == null (u' := coerceInt(objNewWrap(u,source),T)) => -- must be careful in case any of the coeffs come back 0 u' := NIL - zero := getConstantFromDomain('(Zero),T) + zero := getConstantFromDomain($Zero,T) for [e,:c] in u repeat c' := objValUnwrap (coerceInt(objNewWrap(c,S),T) or coercionFailure()) @@ -1491,7 +1491,7 @@ Up2SUP(u,source is [.,x,S],target is [.,T]) == -- try to go underneath first null (u' := coerceInt(objNewWrap(u,source),T)) => u' := NIL - zero := getConstantFromDomain('(Zero),T) + zero := getConstantFromDomain($Zero,T) for [e,:c] in u repeat c' := objValUnwrap (coerceInt(objNewWrap(c,S),T) or coercionFailure()) @@ -1545,7 +1545,7 @@ Var2Dmp(u,source,target is [dmp,vl,S]) == len := #vl -1 ~= (n:= position(sym,vl)) => LIST [LIST2VEC [(n=i => 1; 0) for i in 0..len-1], - :getConstantFromDomain('(One),S)] + :getConstantFromDomain($One,S)] (u := coerceInt(objNewWrap(u,source),S)) or coercionFailure() [[Zeros len,:objValUnwrap u]] @@ -1556,7 +1556,7 @@ Var2Gdmp(u,source,target is [dmp,vl,S]) == len := #vl -1 ~= (n:= position(sym,vl)) => LIST [LIST2VEC [(n=i => 1; 0) for i in 0..len-1], - :getConstantFromDomain('(One),S)] + :getConstantFromDomain($One,S)] (u := coerceInt(objNewWrap(u,source),S)) or coercionFailure() [[Zeros len,:objValUnwrap u]] @@ -1564,7 +1564,7 @@ Var2Mp(u,source,target is [mp,vl,S]) == sym := second source u = '_$fromCoerceable_$ => member(sym,vl) or canCoerce(source,S) (n:= position1(u,vl)) ~= 0 => - [1,n,[1,0,:getConstantFromDomain('(One),S)]] + [1,n,[1,0,:getConstantFromDomain($One,S)]] (u := coerceInt(objNewWrap(u,source),S)) or coercionFailure() [0,:objValUnwrap u] @@ -1575,7 +1575,7 @@ Var2NDmp(u,source,target is [ndmp,vl,S]) == len:= #vl -1 ~= (n:= position(u,vl)) => LIST [LIST2VEC [(n=i => 1; 0) for i in 0..len-1], - :getConstantFromDomain('(One),S)] + :getConstantFromDomain($One,S)] (u := coerceInt(objNewWrap(u,source),S)) or coercionFailure() [[Zeros len,:objValUnwrap(u)]] @@ -1588,7 +1588,7 @@ Var2P(u,source,target is [poly,S]) == u' := coerceInt(objNewWrap(u,source),S) if u' then return [0,:objValUnwrap(u')] -- if that failed, return it as a polynomial variable - [1,sym,[1,0,:getConstantFromDomain('(One),S)]] + [1,sym,[1,0,:getConstantFromDomain($One,S)]] Var2QF(u,source,target is [qf,S]) == u = '_$fromCoerceable_$ => canCoerce(source,S) @@ -1596,7 +1596,7 @@ Var2QF(u,source,target is [qf,S]) == S = $Integer => coercionFailure() sym := second source (u' := coerceInt(objNewWrap(u,source),S)) or coercionFailure() - [objValUnwrap u',:getConstantFromDomain('(One),S)] + [objValUnwrap u',:getConstantFromDomain($One,S)] Var2FS(u,source,target is [fs,S]) == u = '_$fromCoerceable_$ => true @@ -1609,7 +1609,7 @@ Var2Up(u,source,target is [up,x,S]) == sym := second source u = '_$fromCoerceable_$ => (sym = x) or canCoerce(source,S) - x=sym => [[1,:getConstantFromDomain('(One),S)]] + x=sym => [[1,:getConstantFromDomain($One,S)]] (u := coerceInt(objNewWrap(u,source),S)) or coercionFailure() [[0,:objValUnwrap u]] @@ -1617,7 +1617,7 @@ Var2SUP(u,source,target is [sup,S]) == sym := second source u = '_$fromCoerceable_$ => (sym = "?") or canCoerce(source,S) - sym = "?" => [[1,:getConstantFromDomain('(One),S)]] + sym = "?" => [[1,:getConstantFromDomain($One,S)]] (u := coerceInt(objNewWrap(u,source),S)) or coercionFailure() [[0,:objValUnwrap u]] @@ -1769,10 +1769,10 @@ commuteQuaternion(u,source,S,target,T) == commuteFraction(u,source,S,target,T) == u = '_$fromCoerceable_$ => - ofCategory(target,'(Field)) => canCoerce(S,target) + ofCategory(target,$Field) => canCoerce(S,target) canCoerce(S,T) and canCoerce(T,target) [n,:d] := u - ofCategory(target,'(Field)) => + ofCategory(target,$Field) => -- see if denominator can go over to target (d' := coerceInt(objNewWrap(d,S),target)) or coercionFailure() -- if so, try to invert it diff --git a/src/interp/i-funsel.boot b/src/interp/i-funsel.boot index e58d4a3a..4774af7e 100644 --- a/src/interp/i-funsel.boot +++ b/src/interp/i-funsel.boot @@ -324,7 +324,7 @@ defaultTarget(opNode,op,nargs,args) == nargs = 2 => op = "elt" => - a1 = '(BasicOperator) and a2 is ['List, ['OrderedVariableList, .]] => + a1 = $BasicOperator and a2 is ['List, ['OrderedVariableList, .]] => ['Expression, $Integer] target @@ -355,20 +355,20 @@ defaultTarget(opNode,op,nargs,args) == op = "**" or op = "^" => a2 = $Integer => - if (target := resolveTCat(a1,'(Field))) then + if (target := resolveTCat(a1,$Field)) then putTarget(opNode,target) target - a1 = '(AlgebraicNumber) and (a2 = $Float or a2 = $DoubleFloat) => + a1 = $AlgebraicNumber and (a2 = $Float or a2 = $DoubleFloat) => target := ['Expression, a2] putTarget(opNode,target) target - a1 = '(AlgebraicNumber) and a2 is ['Complex, a3] and (a3 = $Float or a3 = $DoubleFloat) => + a1 = $AlgebraicNumber and a2 is ['Complex, a3] and (a3 = $Float or a3 = $DoubleFloat) => target := ['Expression, a3] putTarget(opNode,target) target ((a2 = $RationalNumber) and (typeIsASmallInteger(a1) or isEqualOrSubDomain(a1,$Integer))) => - putTarget(opNode, target := '(AlgebraicNumber)) + putTarget(opNode, target := $AlgebraicNumber) target ((a2 = $RationalNumber) and (isAVariableType(a1) or a1 is ['Polynomial,.] or a1 is ['RationalFunction,.])) => @@ -401,14 +401,14 @@ defaultTarget(opNode,op,nargs,args) == putTarget(opNode, target := $RationalNumber) target a1 = a2 => - if (target := resolveTCat(first args,'(Field))) then + if (target := resolveTCat(first args,$Field)) then putTarget(opNode,target) target a1 is ['Variable,.] and a2 is ['Variable,.] => - putTarget(opNode,target := mkRationalFunction '(Integer)) + putTarget(opNode,target := mkRationalFunction $Integer) target isEqualOrSubDomain(a1,$Integer) and a2 is ['Variable,.] => - putTarget(opNode,target := mkRationalFunction '(Integer)) + putTarget(opNode,target := mkRationalFunction $Integer) target a1 is ['Variable,.] and a2 is ['Polynomial,D] => @@ -446,7 +446,7 @@ defaultTargetFE(a,:options) == a is ['Variable,.] or a = $RationalNumber or MEMQ(a.op, [$Symbol.op, 'RationalRadicals, 'Pi]) or typeIsASmallInteger(a) or isEqualOrSubDomain(a, $Integer) or - a = '(AlgebraicNumber) => + a = $AlgebraicNumber => IFCAR options => [$FunctionalExpression, ['Complex, $Integer]] [$FunctionalExpression, $Integer] a is ['Complex,uD] => defaultTargetFE(uD, true) @@ -786,8 +786,8 @@ findFunctionInDomain(op,dc,tar,args1,args2,$Coerce,$SubDom) == dcName='Enumeration and (args1.0=$Symbol or tar=dc)=> [[[dc, dc, $Symbol], ['$,$Symbol], [NIL, NIL]]] args1.0 ~= dc => NIL - tar and tar ~= $Expression => NIL - [[[dc, $Expression, dc], [$Expression,'$], [NIL, NIL]]] + tar and tar ~= $OutputForm => NIL + [[[dc, $OutputForm, dc], [$OutputForm,'$], [NIL, NIL]]] dcName in '(Record Union) => findFunctionInCategory(op,dc,tar,args1,args2,$Coerce,$SubDom) NIL @@ -1401,13 +1401,13 @@ hasCateSpecial(v,dom,cat,SL) == dom is ['FactoredForm,arg] => if isSubDomain(arg,$Integer) then arg := $Integer d := ['FactoredRing,arg] - SL:= hasCate(arg,'(Ring),augmentSub(v,d,SL)) + SL:= hasCate(arg,$Ring,augmentSub(v,d,SL)) SL = 'failed => 'failed hasCaty(d,cat,SL) cat = $Field or cat = $DivisionRing => if isSubDomain(dom,$Integer) then dom := $Integer d:= eqType [$QuotientField, dom] - hasCaty(dom,'(IntegralDomain),augmentSub(v,d,SL)) + hasCaty(dom,$IntegralDomain,augmentSub(v,d,SL)) cat is ['PolynomialCategory, d, :.] => dom' := ['Polynomial, d] (containsVars d or canCoerceFrom(dom, dom')) @@ -1449,7 +1449,7 @@ hasCateSpecialNew(v,dom,cat,SL) == d := defaultTargetFE $Integer augmentSub(v, d, SL) alg => - d := '(AlgebraicNumber) + d := $AlgebraicNumber --d := defaultTargetFE $Integer augmentSub(v, d, SL) 'failed diff --git a/src/interp/i-output.boot b/src/interp/i-output.boot index 26abb4d7..afbfb7e8 100644 --- a/src/interp/i-output.boot +++ b/src/interp/i-output.boot @@ -1532,7 +1532,7 @@ formulaFormat expr == NIL texFormat expr == - tf := '(TexFormat) + tf := $TexFormat formatFn := getFunctionFromDomain("convert",tf,[$OutputForm,$Integer]) displayFn := getFunctionFromDomain("display",tf,[tf]) @@ -1542,7 +1542,7 @@ texFormat expr == NIL texFormat1 expr == - tf := '(TexFormat) + tf := $TexFormat formatFn := getFunctionFromDomain("coerce",tf, [$OutputForm]) displayFn := getFunctionFromDomain("display",tf,[tf]) SPADCALL(SPADCALL(expr,formatFn),displayFn) @@ -1551,8 +1551,8 @@ texFormat1 expr == NIL mathmlFormat expr == - mml := '(MathMLFormat) - mmlrep := '(String) + mml := $MathMLFormat + mmlrep := $String formatFn := getFunctionFromDomain("coerce",mml,[$OutputForm]) displayFn := getFunctionFromDomain("display",mml,[mmlrep]) SPADCALL(SPADCALL(expr,formatFn),displayFn) @@ -1683,8 +1683,8 @@ printMap1(x,initialFlag) == printBasic second x printBasic x == - x='(One) => PRIN1(1,$algebraOutputStream) - x='(Zero) => PRIN1(0,$algebraOutputStream) + x=$One => PRIN1(1,$algebraOutputStream) + x=$Zero => PRIN1(0,$algebraOutputStream) IDENTP x => PRINTEXP(symbolName x,$algebraOutputStream) atom x => PRIN1(x,$algebraOutputStream) PRIN1(x,$algebraOutputStream) diff --git a/src/interp/i-resolv.boot b/src/interp/i-resolv.boot index 5c9a2051..e76456b5 100644 --- a/src/interp/i-resolv.boot +++ b/src/interp/i-resolv.boot @@ -76,8 +76,8 @@ resolveTT1(t1,t2) == (t1 = '$NoValueMode) or (t2 = '$NoValueMode) => NIL (t1 = $Void) or (t2 = $Void) => $Void (t1 = $Any) or (t2 = $Any) => $Any - t1 = '(Exit) => t2 - t2 = '(Exit) => t1 + t1 = $Exit => t2 + t2 = $Exit => t1 t1 is ['Union,:.] => resolveTTUnion(t1,t2) t2 is ['Union,:.] => resolveTTUnion(t2,t1) string?(t1) => @@ -170,12 +170,12 @@ resolveTTSpecial(t1,t2) == (t1 = $Symbol) and ofCategory(t2, '(IntegerNumberSystem)) => resolveTT1(['Polynomial, t2], t2) - t1 = '(AlgebraicNumber) and (t2 = $Float or t2 = $DoubleFloat) => + t1 = $AlgebraicNumber and (t2 = $Float or t2 = $DoubleFloat) => ['Expression, t2] - t1 = '(AlgebraicNumber) and (t2 = ['Complex, $Float] or t2 = ['Complex, $DoubleFloat]) => + t1 = $AlgebraicNumber and (t2 = ['Complex, $Float] or t2 = ['Complex, $DoubleFloat]) => ['Expression, second t2] - t1 = '(AlgebraicNumber) and t2 is ['Complex,.] => + t1 = $AlgebraicNumber and t2 is ['Complex,.] => resolveTT1('(Expression (Integer)), t2) t1 is ['SimpleAlgebraicExtension,F,Rep,poly] => @@ -189,13 +189,13 @@ resolveTTSpecial(t1,t2) == ['Polynomial,t1] canCoerceFrom(t2,F) => t1 nil - t1 = $PositiveInteger and ofCategory(t2,'(Ring)) => + t1 = $PositiveInteger and ofCategory(t2,$Ring) => resolveTT1($Integer,t2) - t1 = $NonNegativeInteger and ofCategory(t2,'(Ring)) => + t1 = $NonNegativeInteger and ofCategory(t2,$Ring) => resolveTT1($Integer,t2) t1 is ['OrderedVariableList,[x]] => resolveTTSpecial(['Variable, x], t2) t1 is ['OrderedVariableList,vl] => - ofCategory(t2,'(Ring)) => resolveTT(['Polynomial,$Integer],t2) + ofCategory(t2,$Ring) => resolveTT(['Polynomial,$Integer],t2) resolveTT($Symbol,t2) t1 is ['Variable,x] => t2 is ["SimpleAlgebraicExtension",:.] => resolveTTSpecial(t2,t1) @@ -367,9 +367,9 @@ resolveTCat(t,c) == member(c,'((Field) (EuclideanDomain))) and ofCategory(t,'(IntegralDomain))=> eqType [$QuotientField, t] - c = '(Field) and t = $Symbol => ['RationalFunction,$Integer] + c = $Field and t = $Symbol => ['RationalFunction,$Integer] - c = '(Ring) and t is ['FactoredForm,t0] => ['FactoredRing,t0] + c = $Ring and t is ['FactoredForm,t0] => ['FactoredRing,t0] sd := superType t => resolveTCat(sd,c) @@ -479,9 +479,9 @@ resolveTM1(t,m) == -- a tower t=m => t m is ['Union,:.] => resolveTMUnion(t,m) - m = '(Void) => m - m = '(Any) => m - m = '(Exit) => t + m = $Void => m + m = $Any => m + m = $Exit => t containsVars m => isPatternVar m => p := ASSQ(m,$Subst) => diff --git a/src/interp/i-spec1.boot b/src/interp/i-spec1.boot index eacd23d3..ffc57722 100644 --- a/src/interp/i-spec1.boot +++ b/src/interp/i-spec1.boot @@ -213,14 +213,14 @@ upAlgExtension t == throwKeyedMsgCannotCoerceWithValue(objVal(triple), objMode(triple),upmode) newmode := objMode T - (field := resolveTCat(third newmode,'(Field))) or + (field := resolveTCat(third newmode,$Field)) or throwKeyedMsg("S2IS0002",[eq]) pd:= ['UnivariatePolynomial,a,field] null (canonicalAE:= coerceInteractive(T,pd)) => throwKeyedMsgCannotCoerceWithValue(objVal T,objMode T,pd) sae:= ['SimpleAlgebraicExtension,field,pd,objValUnwrap canonicalAE] saeTypeSynonym := INTERN strconc('"SAE",STRINGIMAGE a) - saeTypeSynonymValue := objNew(sae,'(Domain)) + saeTypeSynonymValue := objNew(sae,$Domain) fun := getFunctionFromDomain('generator,sae,NIL) expr:= wrap SPADCALL(fun) putHist(saeTypeSynonym,'value,saeTypeSynonymValue,$e) @@ -1166,7 +1166,7 @@ declareMap(var,mode) == getAndEvalConstructorArgument tree == triple := getValue tree - objMode triple = '(Domain) => triple + objMode triple = $Domain => triple isWrapped objVal(triple) => triple isLocallyBound objVal triple => compFailure('" Local variable or parameter used in type") diff --git a/src/interp/i-spec2.boot b/src/interp/i-spec2.boot index 882d5795..9e46ef6b 100644 --- a/src/interp/i-spec2.boot +++ b/src/interp/i-spec2.boot @@ -707,8 +707,8 @@ upTableSetelt(op,lhs is [htOp,:args],rhs) == throwKeyedMsg("S2IS0041",[[getUnname htOp,'".[", getUnname first args, ['",",getUnname arg for arg in rest args],'"]"]]) - keyMode := '(Any) - putMode (htOp,['Table,keyMode,'(Any)]) + keyMode := $Any + putMode (htOp,['Table,keyMode,$Any]) -- if we are to use a new table, we must call the "table" -- function to give it an initial value. bottomUp [mkAtreeNode "%LET",htOp,[mkAtreeNode 'table]] diff --git a/src/interp/i-toplev.boot b/src/interp/i-toplev.boot index 616a8bf8..03d8edf7 100644 --- a/src/interp/i-toplev.boot +++ b/src/interp/i-toplev.boot @@ -186,7 +186,7 @@ recordAndPrint(x,md) == -- Prints out the value x which is of type m, and records the changes -- in environment $e into $InteractiveFrame -- $printAnyIfTrue is documented in setvart.boot. controlled with )se me any - if md = '(Any) and $printAnyIfTrue then + if md = $Any and $printAnyIfTrue then md' := first x x' := rest x else diff --git a/src/interp/pspad1.boot b/src/interp/pspad1.boot index b478826c..40fe464f 100644 --- a/src/interp/pspad1.boot +++ b/src/interp/pspad1.boot @@ -368,8 +368,8 @@ formatForm (u) == $fieldNames := union(getFieldNames argl,$fieldNames) op in '(true %true) => format "true" op in '(false nil) => format op - u='(Zero) => format 0 - u='(One) => format 1 + u=$Zero => format 0 + u=$One => format 1 1=#argl => formatApplication u formatFunctionCall u diff --git a/src/interp/record.boot b/src/interp/record.boot index c67d1922..625ef097 100644 --- a/src/interp/record.boot +++ b/src/interp/record.boot @@ -110,7 +110,7 @@ printRecordFile(pathname,:option) == for x in i repeat sayBrightly x sayNewLine() for x in o repeat maPrin x - if t ~= '(Void) then printTypeAndTime(nil,t) + if t ~= $Void then printTypeAndTime(nil,t) testPrin(u,w) == --same as maPrin but lines are stored in $testOutputLineList --these lines are needed for pasting into HT files diff --git a/src/interp/sys-constants.boot b/src/interp/sys-constants.boot index 9a1fbcff..11779c82 100644 --- a/src/interp/sys-constants.boot +++ b/src/interp/sys-constants.boot @@ -328,14 +328,7 @@ $SideEffectFreeFunctionList == MEMBER _ _is _ _isnt _ - ATOM _ - $_= _ - $_> _ - $_>_= _ - $_< _ - $_<_= _ - $_^_= _ - $MEMBER) + ATOM) --% Types @@ -346,12 +339,24 @@ $Field == $DivisionRing == '(DivisionRing) +$IntegralDomain == + '(IntegralDomain) + $CombinatorialFunctionCategory == '(CombinatorialFunctionCategory) +$Ring == + '(Ring) + $Group == '(Group) +$AbelianMonoid == + '(AbelianMonoid) + +$Monoid == + '(Monoid) + ++ The Void domain constructor form $Void == '(Void) @@ -368,6 +373,12 @@ $None == $Syntax == '(Syntax) +$BasicOperator == + '(BasicOperator) + +$AlgebraicNumber == + '(AlgebraicNumber) + ++ Boolean domain constructor form $Boolean == '(Boolean) @@ -464,9 +475,11 @@ $InputForm == $FunctionalExpression == 'Expression -++ Expression domain constructor form -$Expression == - '(OutputForm) +$TexFormat == + '(TexFormat) + +$MathMLFormat == + '(MathMLFormat) ++ The constructor form for unnamed functions. $AnonymousFunction == diff --git a/src/interp/wi1.boot b/src/interp/wi1.boot index 509485b9..08de7a26 100644 --- a/src/interp/wi1.boot +++ b/src/interp/wi1.boot @@ -347,7 +347,7 @@ compAtom(x,m,e) == -- integer? x and (T := [x, $Integer,e]) and (T' := convert(T,m)) => markAt(T, T') t:= IDENTP x => compSymbol(x,m,e) or return nil - m = $Expression and primitiveType x => [x,m,e] + m = $OutputForm and primitiveType x => [x,m,e] string? x => x ~= '"failed" and (member($Symbol, $localImportStack) or member($Symbol, $globalImportStack)) => markAt [x, '(String), e] @@ -381,7 +381,7 @@ compSymbol(s,m,e) == [s,m',e] --s is a declared argument MEMQ(s,$FormalMapVariableList) => stackMessage ["no mode found for",s] ---> - m = $Symbol or m = $Expression => [['QUOTE,s],m,e] + m = $Symbol or m = $OutputForm => [['QUOTE,s],m,e] ---> was ['QUOTE, s] not isFunction(s,e) => errorRef s @@ -409,7 +409,7 @@ compForm1(form,m,e) == -- foobar domain -- markImport(domain,true) -------> new <------------- - domain=$Expression and op'="construct" => compExpressionList(argl,m,e) + domain=$OutputForm and op'="construct" => compExpressionList(argl,m,e) (op'="COLLECT") and coerceable(domain,m,e) => (T:= comp([op',:argl],domain,e) or return nil; coerce(T,m)) -------> new <------------- @@ -885,7 +885,7 @@ coerceExtraHard(T is [x,m',e],m) == unionLike?(m',e) is ['UnionCategory,:l] and (t:= hasType(x,e)) and member(t,l) and (T':= autoCoerceByModemap(T,t)) and (T'':= coerce(T',m)) => T'' - m' is ['Record,:.] and m = $Expression => + m' is ['Record,:.] and m = $OutputForm => [['coerceRe2E,x,['ELT,COPY m',0]],m,e] nil |