Re: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Dennis Clark
The issue here is not one of static vs. dynamic languages. JavaScript is dynamic but doesn't have this difficulty with booleans that Adobe CF has. The problem is due to two characteristics of Adobe CFML: 1. Boolean is not a true primitive type. 2. Boolean operators return the string "YES" f

RE: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Steve Onnis
: [cfaussie] Converting boolean YES to true TBH you would have to fix it yourself, I can't see Adobe fixing it soon as it is likely a legacy issue, I would imagine if they change how it works to the way we expect it should, any code using specifically the old behaviour would error ... so

Re: [cfaussie] Converting boolean YES to true

2011-08-04 Thread AJ Mercer
heads up - this is CF9 ( Railo 3.3 code) On 4 August 2011 15:40, Mark Mandel wrote: > #(value ? "true" : "false" )# > > There you go. > > CF is dynamic, so true is YES is 1... if you want static values, use a > static language. There are pros and cons both ways. > > Mark > -- > *AJ Mercer*

Re: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Mark Mandel
#(value ? "true" : "false" )# There you go. CF is dynamic, so true is YES is 1... if you want static values, use a static language. There are pros and cons both ways. Mark On Thu, Aug 4, 2011 at 5:33 PM, Barry Beattie wrote: > so, what's !YES ... is it NO? > > is anything that can be construe

Re: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Barry Beattie
so, what's !YES ... is it NO? is anything that can be construed as a YES (True, 1, etc) considered a YES and therefore the opposite is NO? On Thu, Aug 4, 2011 at 5:30 PM, Chong wrote: > TBH you would have to fix it yourself, I can't see Adobe fixing it soon as > it is likely a legacy issue,

Re: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Chong
TBH you would have to fix it yourself, I can't see Adobe fixing it soon as it is likely a legacy issue, I would imagine if they change how it works to the way we expect it should, any code using specifically the old behaviour would error ... so they are probably stuck till they can agree on an e

Re: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Paul Kukiel
..true ? or maybe it is YES J > > ** ** > > *From:* Paul Kukiel [mailto:kuki...@gmail.com] > *Sent:* Thursday, 4 August 2011 5:13 PM > > *To:* cfaussie@googlegroups.com > *Subject:* Re: [cfaussie] Converting boolean YES to true > > ** ** > > Its odd th

RE: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Steve Onnis
Yeah it can be fixed with if/else but should it be? We want to write "less" code, not more...true ? or maybe it is YES J From: Paul Kukiel [mailto:kuki...@gmail.com] Sent: Thursday, 4 August 2011 5:13 PM To: cfaussie@googlegroups.com Subject: Re: [cfaussie] Converting boolean Y

RE: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Steve Onnis
om Subject: Re: [cfaussie] Converting boolean YES to true "Also can anyone one recommend a way to do this now? I tried JavaCast(“Boolean”, foo) but that didn’t work." have you seen this? http://www.coldfusionmuse.com/index.cfm/2010/2/5/Booleans.and.Coldfusion Also, have you confirmed you ha

Re: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Paul Kukiel
ything. > > I want !true to give me false, not NO > > -Original Message- > From: Zac Spitzer [mailto:zac.spit...@gmail.com] > Sent: Thursday, 4 August 2011 4:56 PM > To: cfaussie@googlegroups.com > Subject: Re: [cfaussie] Converting boolean YES to true > > It&

RE: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Steve Onnis
: cfaussie@googlegroups.com Subject: Re: [cfaussie] Converting boolean YES to true It's an annoying bug in Adobe CF, Railo works as expected http://stackoverflow.com/questions/1867728/how-can-i-prevent-serializejson-f rom-changing-yes-no-true-false-strings-to-boolea/6661460#6661460 z On Thu,

RE: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Steve Onnis
Wrong way I want it to be true|false -Original Message- From: Zac Spitzer [mailto:zac.spit...@gmail.com] Sent: Thursday, 4 August 2011 4:56 PM To: cfaussie@googlegroups.com Subject: Re: [cfaussie] Converting boolean YES to true It's an annoying bug in Adobe CF, Railo works as exp

Re: [cfaussie] Converting boolean YES to true

2011-08-04 Thread Barry Beattie
"Also can anyone one recommend a way to do this now? I tried JavaCast(“Boolean”, foo) but that didn’t work." have you seen this? http://www.coldfusionmuse.com/index.cfm/2010/2/5/Booleans.and.Coldfusion Also, have you confirmed you have a true boolean? What I'm getting at is the difference betwee

Re: [cfaussie] Converting boolean YES to true

2011-08-03 Thread Zac Spitzer
It's an annoying bug in Adobe CF, Railo works as expected http://stackoverflow.com/questions/1867728/how-can-i-prevent-serializejson-from-changing-yes-no-true-false-strings-to-boolea/6661460#6661460 z On Thu, Aug 4, 2011 at 4:39 PM, Steve Onnis wrote: > I have been coming across this issue more

[cfaussie] Converting boolean YES to true

2011-08-03 Thread Steve Onnis
I have been coming across this issue more and more when dealing with JavaScript and JSON which is ColdFusion changing true|false to YES|NO values. For example:- #foo# = true #foo# = NO Now take this JSON string for example {"foo":#foo#} would then become {"foo":NO} which the