Exactly, Barney.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Barney Boisvert
Sent: Thursday, May 12, 2005 4:03 PM
To: [email protected]
Subject: Re: [CFCDev] Null values (was CFC wish-list)

How about a function that needs to return an object that may or may
not exist.  You HAVE to declare the method as returntype="any" and
return some random thing (like the empty string) if the object is
missing.  If you could just return null, then you could leave your
returntype set to the proper object type, since 'null' fulfills the
role of any type.

Since CF is loosely typed, there's no real need for a null, since a
given value never has any type at all.  However, since MM did allow
specifying types in CFARGUMENT and the returntype attribute, you've
got a bit of a problem.  If you never specify types (proceeding with a
truly loosely typed language), you don't need null, but if you want to
use types to aid in runtime error checking, you're severely limited by
not having null.

cheers,
barneyb

On 5/12/05, Steve Bryant <[EMAIL PROTECTED]> wrote:
> Why is it that you can't protect against runtime errors without a null
value?
> 
> Steve
> 
> At 01:48 PM 5/12/2005, you wrote:
> >Agreed, Brian. Also, one thing that absolutely should make it into CFCs:
a
> >null value. Without this, you can't protect against runtime errors.
> 

-- 
Barney Boisvert
[EMAIL PROTECTED]
360.319.6145
http://www.barneyb.com/

Got Gmail? I have 50 invites.


----------------------------------------------------------
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]


Reply via email to