Index: cpp/frams/vm/classes/collectionobj.cpp
===================================================================
--- cpp/frams/vm/classes/collectionobj.cpp	(revision 332)
+++ cpp/frams/vm/classes/collectionobj.cpp	(revision 333)
@@ -203,5 +203,5 @@
 {
 public:
-bool operator()(const ExtValue *a,const ExtValue *b) {return a->compare(*b)<0;}
+bool operator()(const ExtValue *a,const ExtValue *b) {return a->compare(*b)==ExtValue::ResultLower;}
 };
 
Index: cpp/frams/vm/framscript.y
===================================================================
--- cpp/frams/vm/framscript.y	(revision 332)
+++ cpp/frams/vm/framscript.y	(revision 333)
@@ -28,4 +28,5 @@
 void warnTruthValue(const TokenValue& t);
 void outFunName(const TokenValue& t);
+static bool resultIsRelaxedEqual(ExtValue::CompareResult res);
 
 static const char* assign_op_names[]={"add","sub","mul","div","mod"};
@@ -46,7 +47,7 @@
 %left NEG     /* negation--unary minus */
 %left TYPEOF
-%left INT
-%left FLOAT
-%left STRING
+%left INT_TYPE
+%left FLOAT_TYPE
+%left STRING_TYPE
 
 %token IDENT
@@ -67,8 +68,8 @@
 %token DEFAULT  "default"
 
-%token TYPEOF    "typeof"
-%token INT       "int"
-%token FLOAT     "float"
-%token STRING    "string"
+%token TYPEOF      "typeof"
+%token INT_TYPE    "int"
+%token FLOAT_TYPE  "float"
+%token STRING_TYPE "string"
 
 %token ASM     
@@ -704,5 +705,5 @@
                              {trctx.out->printf("type s0,s0\n");}
                      }
-       | INT '(' expr ')' { trctx.emitLine(); $$.ident=0;
+       | INT_TYPE '(' expr ')' { trctx.emitLine(); $$.ident=0;
                        if ($3.constant)
 			     {$$.constant=1; $$=ExtValue($3.getInt());}
@@ -710,5 +711,5 @@
                              {trctx.out->printf("conv 1,s0\n");}
                      }
-       | FLOAT '(' expr ')' { trctx.emitLine(); $$.ident=0;
+       | FLOAT_TYPE '(' expr ')' { trctx.emitLine(); $$.ident=0;
                        if ($3.constant)
 			     {$$.constant=1; $$=ExtValue($3.getDouble());}
@@ -716,5 +717,5 @@
                              {trctx.out->printf("conv 2,s0\n");}
                      }
-       | STRING '(' expr ')' { trctx.emitLine(); $$.ident=0;
+       | STRING_TYPE '(' expr ')' { trctx.emitLine(); $$.ident=0;
                        if ($3.constant)
 			     {$$.constant=1; $$=ExtValue($3.getString());}
@@ -748,6 +749,6 @@
  if ($1.constant)
 	 {
-	 int cond=$1.compare(ExtValue::zero());
-	 if ((cond==0)||(cond==2))
+	 ExtValue::CompareResult cond=$1.compare(ExtValue::zero());
+	 if (resultIsRelaxedEqual(cond))
 		 {
 		 $1.counter=0;
@@ -776,6 +777,6 @@
 	 if (!($1.constant && $1.counter==0))
 		 {
-		 int cond=$4.compare(ExtValue::zero());
-		 bool value=!((cond==0)||(cond==2));
+		 ExtValue::CompareResult  cond=$4.compare(ExtValue::zero());
+		 bool value=!resultIsRelaxedEqual(cond);
 		 trstack.adjust(-1);
 		 trctx.out->printf("push %d\n",value);
@@ -803,6 +804,6 @@
  if ($1.constant)
 	 {
-	 int cond=$1.compare(ExtValue::zero());
-	 if (!((cond==0)||(cond==2)))
+	 ExtValue::CompareResult  cond=$1.compare(ExtValue::zero());
+	 if (!resultIsRelaxedEqual(cond))
 		 {
 		 $1.counter=1;
@@ -831,6 +832,6 @@
 	 if (!($1.constant && $1.counter==1))
 		 {
-		 int cond=$4.compare(ExtValue::zero());
-		 bool value=!((cond==0)||(cond==2));
+		 ExtValue::CompareResult cond=$4.compare(ExtValue::zero());
+		 bool value=!resultIsRelaxedEqual(cond);
 		 trstack.adjust(-1);
 		 trctx.out->printf("push %d\n",value);
@@ -854,5 +855,5 @@
                          trctx.emitLine(); $$.assign=$2.assign; $$.parens=0; $$.ident=0;
                          if ($2.constant)
-				 {$$.constant=1; int res=$2.compare(ExtValue((paInt)0)); $$.setInt((res==0)||(res==2));}
+				 {$$.constant=1; ExtValue::CompareResult res=$2.compare(ExtValue((paInt)0)); $$.setInt(resultIsRelaxedEqual(res));}
                          else
 				{trctx.out->printf("setif ~=,s0,s0\n");}
@@ -1427,5 +1428,5 @@
 	{
 	result.constant=1;
-	int cmp=arg1.compare(arg2);
+	ExtValue::CompareResult cmp=arg1.compare(arg2);
 	ExtValue::CmpContext context;
 	context.v1=&arg1;
@@ -1458,4 +1459,9 @@
 }
 
+static bool resultIsRelaxedEqual(ExtValue::CompareResult res)
+{
+return (res==ExtValue::ResultEqual)||(res==ExtValue::ResultEqualUnordered)||(res==ExtValue::ResultUnequal_RelaxedEqual);
+}
+
 bool variableOk(TokenValue &tok, const TokenValue& var,int &loc)
 {
