+1 from me too. However, two questions:
a) does this impact the overall performance more than expected?
b) is this also supported for serializeJSON()?
(I hope both questions have a yes)
Most definitely!
Would the behaviour of structkeyexists then change?
I.e. if a key exists and is null, this returns false now.
What happens if a key doesn't exist?
Eg. would this work: struct.a == null, if there is no key a (also not a null valued one)?
(I hope both questions have a yes)
var myvalue = someFunctionCallThatReturnsNull();
IsDefined('myvalue')
May return true because myvalue no longer exists in the local scope so ColdFusion now searches through variables, URL, form, cookie scopes. Dangerous stuff.
No more null placeholders, no more empty strings as null, no more 0 values for integers, and finally the possibility to reckognize a boolean that has not been set!
And I would go a step further; f**k the cfml advisory commitee, and make nulls default available in Railo :p
Cheers Rainer.
I can't recall any coalesce() kind of functions. Would one make sense now?
Any feel for a final release date out of curiosity? I think we'll need some changes in ColdBox to support this change.
Thanks!
Brad
IsDefined("local.myValue") is a bit more specific as long as you haven't defined variables.local.myValue :)
Brad
The pain points will come for people who treat null struct keys as non-existant, etc. Especially frameworks that need to maintain compatibility with ACF and previous versions of Railo. What's worse is the code might not error, but just quietly start producing different results.
Brad
Good stuff ! Will the null values also be returnable ? At the moment we use constructions like return isNull(x) ? nullValue() : x; but preferably we would just like to use return x;
What will happen when outputting nulls from a database query?
What will get output with <cfoutput> #myNullVar# </cfoutput>?
Also, how will operators treat null like concatenation or addition? Ie, what is a string concatenated with null our a number added to null?
I can't recall any coalesce() kind of functions. Would one make sense now?
Any feel for a final release date out of curiosity? I think we'll need some changes in ColdBox to support this change.
Thanks!
Brad
IsDefined("local.myValue") is a bit more specific as long as you haven't defined variables.local.myValue :)
Brad
Good stuff ! Will the null values also be returnable ? At the moment we use constructions like return isNull(x) ? nullValue() : x; but preferably we would just like to use return x;
2012/12/5 Brad Wood <br...@bradwood.com>
What will happen when outputting nulls from a database query?there is no change with that, null in query object is still equal to a empty String, a lot of code is depending on this behavior, but we could make a configuration setting for this.
It's just awesome.I don't like to declare variables if a wrong type:var q_Products = ""; // it will be a query, not a string
I have two doubts:1) What will return Len(nullVariable)?
2) What will return isEmpty(nullVariable)?
Ronan
Too simple... In the spirit of CFML the function for that would be: TrashTakeOutAndEmpty()
--
typos, misspels, and other weird words brought to you courtesy of my mobile device.
For the sake of consistency -- shouldn't the Empty() BIF be named isEmpty() like the other decision functions?
If so -- we should do it now before Empty() gains popularity and much use
Igal
--
typos, misspels, and other weird words brought to you courtesy of my mobile device.