And look how well CF handles *those* situations. Anyway, that's a bit of a contrivance, and only goes to further demonstrate that CF doesn't handle nulls very well
Well, CF doesn't actually have the concept of null at all. That's why it is so hard to work with Java nulls - CF has no language for it.
<cfset a = arrayNew(1)> <cfset a[2] = "something">
A[1] is null.
Ah, yes...
<cfset var myVar>
Of course what we really need is for null to be an integral part of the CF language so that we can say:
<cfset var myVar = null>
(which makes perfect sense in Java) and also be able to test for variables being null:
<cfif a[1] is null>
...
</cfif>CF would need quite a bit of work to handle null values (this always seems to cause disagreement - I'm stating this as a language designer and compiler writer of many years: null is a fundamental language construct and if a language doesn't have it, it's a lot of work to add it and still have a consistent language).
Consider structKeyExists(s,"foo") - how should it behave if s.foo = null? Currently it says "false" but if you preserve that behavior, you can't tell the difference between a missing element and a null-valued element (i.e., it's hard to elevate null to a first class citizen in the language without breaking other assumptions or introduces more weird corner cases).
Regards, Sean
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]
