From d68d655abaef0d14652e07608c633b1ff1feefda Mon Sep 17 00:00:00 2001 From: dos-reis Date: Fri, 17 Oct 2008 23:51:50 +0000 Subject: Fix AW/271 * interp/sys-constants.boot ($Field): New. * interp/i-coerce.boot (retract2Specialization): Ignore expressions whose types do no belong to Field. --- src/interp/i-coerce.boot | 10 ++++++---- src/interp/sys-constants.boot | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src/interp') diff --git a/src/interp/i-coerce.boot b/src/interp/i-coerce.boot index 35a0e23b..4a145952 100644 --- a/src/interp/i-coerce.boot +++ b/src/interp/i-coerce.boot @@ -214,10 +214,12 @@ retract2Specialization object == type is ['Expression,D] => atom val' => nil -- certainly not a fraction [num,:den] := val' - -- coerceRetract already handles case where den = 1 - num isnt [0,:num] => NIL - den isnt [0,:den] => NIL - objNewWrap([num,:den],[$QuotientField, D]) + ofCategory(type,$Field) => + -- coerceRetract already handles case where den = 1 + num isnt [0,:num] => NIL + den isnt [0,:den] => NIL + objNewWrap([num,:den],[$QuotientField, D]) + nil type is ['SimpleAlgebraicExtension,k,rep,.] => -- try to retract as an element of rep and see if we can get an -- element of k diff --git a/src/interp/sys-constants.boot b/src/interp/sys-constants.boot index f6c9ef10..f4468e15 100644 --- a/src/interp/sys-constants.boot +++ b/src/interp/sys-constants.boot @@ -331,6 +331,10 @@ $SideEffectFreeFunctionList == --% Types +++ The Field category form +$Field == + '(Field) + ++ The Void domain constructor form $Void == '(Void) -- cgit v1.2.3