I think it's a fine suggestion. However, I still think a function should
have to declare that it may return null values:
<cffunction name="getCustomer" returntype="Customer" allownull="yes">
...
</cffunction>
AllowNull should be defaulted to "no". That would be backwards compatible
with the existing ColdFusion code which is blissfully unaware of null
values.
Ben Rogers
http://www.c4.net
v.508.240.0051
f.508.240.0057
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
> Of Vince Bonfanti
> Sent: Friday, May 13, 2005 9:03 AM
> To: [email protected]
> Subject: RE: [CFCDev] Null values (was CFC wish-list)
>
> 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]
----------------------------------------------------------
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]