Nope - tried that too!

Here's an even _creepier_ one:

<cfset x = "-NaN">
<cfset y = "-NaN">

<cfoutput>#x is y#</cfoutput>

Guess what that displays . . . "No"!!!!

That actually causes an infinite loop in some recursive input filtering
routines we use!

This is getting really frustrating now.  Now I have to add all kinds of
exceptional conditions in our code.  I'm opening a support incident with MM
as we speak....

Roland

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Ryan Guill
Sent: Wednesday, June 22, 2005 2:56 PM
To: [email protected]
Subject: Re: [CFCDev] OT: "NaN" is a reserved word in cf?

just for kicks, swap IS for EQ and see if it makes any difference.

On 6/22/05, Roland Collins <[EMAIL PROTECTED]> wrote:
> It still doesn't work.  It gets converted back, which is what makes this
> frustrating.  No matter how you format it, the error occurs.
> 
> <cfset x = "NaN">
> <cfset y = 1>
> <cfoutput>#(x.toString() is y.toString())#</cfoutput>
> 
> Still generates an error.
> 
> :(
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Ryan Guill
> Sent: Wednesday, June 22, 2005 12:12 PM
> To: [email protected]
> Subject: Re: [CFCDev] OT: "NaN" is a reserved word in cf?
> 
> Youre expecting a string right?  What happens if you do toString() on it
> first?
> 
> On 6/22/05, Jeff Anderson <[EMAIL PROTECTED]> wrote:
> > based off of that last test i do not believe it is an issue with "NaN"
or
> > "1" but rather the way the IS operator does its comparisons
> >
> >
> >
> > On 6/22/05, Bill Rawlinson <[EMAIL PROTECTED]> wrote:
> > > I tested this on CFMX 6.1 and have the same behavior.
> > >
> > > I expanded your test some to do a getMetaData. Here is my test and I
> > > put the result of each cfoutput block to the right in parentheses.
> > >
> > >
> > > <cfset s = "NaN">
> > >
> > > <cfoutput>
> > > #getMetaData(s)#<br>  (class java.lang.String)
> > > #getMetaData("1")#<br>  (class java.lang.String)
> > > </cfoutput>
> > >
> > > <cfset s = "one">
> > > <cfset test = (s is "1")>
> > > <cfoutput>#test# - #getMetaData(s)#</cfoutput><br>   (NO
> > class java.lang.String )
> > >
> > > <cfset s = "NaN">
> > > <cfset test = (s is "one")>
> > > <cfoutput>#test# - #getMetaData(s)#</cfoutput><br> (NO class
> > java.lang.String)
> > >
> > > <cfset s = "NaN">
> > > <cfset test = (s is "1")>
> > > <cfoutput>#test#</cfoutput><br>  ( The value "NaN" cannot
> > be converted
> > > to a number)
> > >
> > >
> > > wierd stuff
> > > Bill
> > >
> > >
> > > On 6/22/05, Roland Collins < [EMAIL PROTECTED]> wrote:
> > > > I'm seeing a very odd and very troubling behavior in CF, which I'm
> > hoping
> > > > someone can shed some light on or just confirm the oddity.  It
appears
> > that
> > > > "NaN" is a reserved word in CF, presumably because it is the "Not a
> > Number"
> > > > constant in Java", even though it shouldn't be.  Dump this code in a
> > page
> > > > and try it in CF (I'm using 7):
> > > >
> > > > <cfset s = "one">
> > > > <cfset test = (s is "1")>
> > > > <cfoutput>#test#</cfoutput>
> > > >
> > > > <cfset s = "NaN">
> > > > <cfset test = (s is "one")>
> > > > <cfoutput>#test#</cfoutput>
> > > >
> > > > <cfset s = "NaN">
> > > > <cfset test = (s is "1")>
> > > > <cfoutput>#test#</cfoutput>
> > > >
> > > > Now, I would _expect_ the code to generate "No No No".  But guess
what
> 
> > > > happens . . . The first two statements work fine, but the third one
> > throws a
> > > > *type conversion* error.  More specifically, it throws "The value
> "NaN"
> > > > cannot be converted to a number".
> > > >
> > > > Type-less language, my backside!  Why is it trying to do a number
> > conversion
> > > > here?  I even have the "1" in quotes, for Pete's sake.  It doesn't
> even
> > work
> > > > if I add spaces around it, as in " NaN " or " 1 ".  And it gets even
> > > > _sloppier_ . . . this only occurs if you use the capitalization
"NaN".
> > > > "NAN", "Nan", "nan", etc. work just fine.  Since when is CF
> > > > case-sensitive??!?!?!
> > > >
> > > > Now here's why it's a problem - "NAN" is a perfectly valid
user-input
> > > > statement in our system (think stock symbols).  So now whenever we
> > perform
> > > > user-validation, we have to have a special filter for "NaN" and make
> > sure it
> > > > is converted to either all upper or all lower case!
> > > >
> > > > Does anyone else find this frightening?
> > > >
> > > > Does anyone know where the link to report CF bugs went?
> > > >
> > > > Roland
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > ----------------------------------------------------------
> > > > You are subscribed to cfcdev. To unsubscribe, send an email to
> > [email protected] with the words 'unsubscribe cfcdev' as the subject of
> the
> > email.
> > > >
> > > > CFCDev is run by CFCZone (www.cfczone.org) and supported by
CFXHosting
> (
> > www.cfxhosting.com).
> > > >
> > > > CFCDev is supported by New Atlanta, makers of BlueDragon
> > > > http://www.newatlanta.com/products/bluedragon/index.cfm
> > > >
> > > > An archive of the CFCDev list is available at
> > www.mail-archive.com/[email protected]
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > [EMAIL PROTECTED]
> > > http://blog.rawlinson.us
> > >
> > > If you want Gmail - just ask.
> > >
> > >
> > >
> > ----------------------------------------------------------
> > > You are subscribed to cfcdev. To unsubscribe, send an email to
> > [email protected] with the words 'unsubscribe cfcdev' as the subject of
> the
> > email.
> > >
> > > CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(
> > www.cfxhosting.com).
> > >
> > > CFCDev is supported by New Atlanta, makers of BlueDragon
> > > http://www.newatlanta.com/products/bluedragon/index.cfm
> > >
> > > An archive of the CFCDev list is available at
> > www.mail-archive.com/[email protected]
> > >
> > >
> > >
> >
> >  ----------------------------------------------------------
> >
> > You are subscribed to cfcdev. To unsubscribe, send an email to
> > [email protected] with the words 'unsubscribe cfcdev' as the subject of
> the
> > email.
> >
> > CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
> > (www.cfxhosting.com).
> >
> > CFCDev is supported by New Atlanta, makers of BlueDragon
> > http://www.newatlanta.com/products/bluedragon/index.cfm
> >
> > An archive of the CFCDev list is available at
> > www.mail-archive.com/[email protected]
> 
> 
> --
> Ryan Guill
> BlueEyesDevelopment
> [EMAIL PROTECTED]
> www.ryanguill.com
> (270) 217.2399
> Want gmail? Get it here while its hot.
> 
> www.ryanguill.com/blog/
> 
> 
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email to
> [email protected] with the words 'unsubscribe cfcdev' as the subject of
the
> email.
> 
> CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
> (www.cfxhosting.com).
> 
> CFCDev is supported by New Atlanta, makers of BlueDragon
> http://www.newatlanta.com/products/bluedragon/index.cfm
> 
> An archive of the CFCDev list is available at
> www.mail-archive.com/[email protected]
> 
> 
> 
> 
> 
> 
> 
> ----------------------------------------------------------
> You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
> 
> CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
> 
> CFCDev is supported by New Atlanta, makers of BlueDragon
> http://www.newatlanta.com/products/bluedragon/index.cfm
> 
> An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]
> 
> 
> 


-- 
Ryan Guill
BlueEyesDevelopment
[EMAIL PROTECTED]
www.ryanguill.com
(270) 217.2399
Want gmail? Get it here while its hot.

www.ryanguill.com/blog/


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]







----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to 
[email protected] with the words 'unsubscribe cfcdev' as the subject of the 
email.

CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting 
(www.cfxhosting.com).

CFCDev is supported by New Atlanta, makers of BlueDragon
http://www.newatlanta.com/products/bluedragon/index.cfm

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]


Reply via email to