Update of /cvsroot/monetdb/pathfinder/compiler/mil
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv12750/mil

Modified Files:
        milgen.brg 
Log Message:
-- added new 'lax' variant of fn:number that ignores NaN values.


U milgen.brg
Index: milgen.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/mil/milgen.brg,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -d -r1.130 -r1.131
--- milgen.brg  5 Apr 2008 13:41:43 -0000       1.130
+++ milgen.brg  7 Apr 2008 11:01:09 -0000       1.131
@@ -4664,7 +4664,8 @@
 
                     res_type = aat_str;
                 }   break; /* fold) */
-                case alg_fun_fn_number: /* fold( */
+                case alg_fun_fn_number:
+                case alg_fun_fn_number_lax: /* fold( */
                 {
                     PFalg_att_t         att   = p->sem.fun_1to1.refs.atts[0];
                     PFalg_simple_type_t ty    = type_of (L(p), att);
@@ -4701,15 +4702,16 @@
                                                     var (res->name))));
                         }
 
-                    /* As we do not support the value NaN we need to generate
-                       an error for all tuples that cannot be casted (instead
-                       of generating NaN). */
-                    execute (
-                        if_ (exist (reverse (var (res->name)),
-                                    cast (implty (res_type), nil ())),
-                             error (
-                                 lit_str ("We do not support the value NaN.")),
-                             nop ()));
+                    if (p->sem.fun_1to1.kind == alg_fun_fn_number)
+                        /* As we do not support the value NaN we need to 
generate
+                           an error for all tuples that cannot be casted 
(instead
+                           of generating NaN). */
+                        execute (
+                            if_ (exist (reverse (var (res->name)),
+                                        cast (implty (res_type), nil ())),
+                                 error (
+                                     lit_str ("We do not support the value 
NaN.")),
+                                 nop ()));
                 }   break; /* fold) */
                 case alg_fun_fn_qname: /* fold( */
                 {


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to