CF7 already has the ability to do most of this:
<cfset nullValue = JavaCast("null","") />
<cfif not structKeyExists(variables,'nullValue')>
Null Value found.
</cfif>The only thing it doesn't support is returning a null instead of say a struct or a query.
If you could do <cfreturn JavaCast("null","") /> I'd be happy.Spike
Vince Bonfanti wrote:
What if the concept of null values was introduced via two new functions: NullNew() and IsNull()? I could assign a null value to variables with the first function:
<cfset myNull=NullNew()>
<cfreturn NullNew()>
You could also use NullNew() to pass null values to Java function instead of using JavaCast("null", "").
For purposes of type-checking for CFARGUMENT and CFRETURN, a value returned by NullNew() will match any type.
For those who want loose typing, a value return by NullNew() will look like an empty string. In other words, the following CFIFs would both evaluate to TRUE:
<cfif IsNull( myNull )>
<cfif myNull EQ "">
It seems to me that this would be fully backwards-compatible and be relatively easy to implement.
Vince Bonfanti
http://blog.newatlanta.com
New Atlanta Communications, LLC
http://www.newatlanta.com
---------------------------------------------------------- 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]
--
-------------------------------------------- Stephen Milligan Code poet for hire http://www.spike.org.uk
Do you cfeclipse? http://cfeclipse.tigris.org
---------------------------------------------------------- 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]
