Hal, Honestly, I don't think I know the answer to this one, but ...
The type validation (parameters and return values) in CFCs were originally put there to support Web Services (so as to be able to generate the appropriate WSDL). I do not believe they are really that integrated into core language processing - using a <CFARGUMENT> to set a type to numeric is actually a lot more a shortcut for some <CFIF> tags than it is true type processing. --- Ben -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hal Helms Sent: Monday, August 04, 2003 5:44 PM To: [EMAIL PROTECTED] Subject: RE: [CFCDev] Overloading CFCs Ben, Something has puzzled me and I wonder if you'd care to comment on it: We know that CF is a weakly-typed language, yet CFCs allow returntypes to be defined for methods and types to be defined for arguments. If this is done, CF will enforce some form of runtime type-checking. What would be the major impediment to overloaded methods then? If we can and do have runtime type-checking, wouldn't overloaded methods be at least possible? I suspect, though, that there's something I don't understand that would make this impractical, but I'd love to know what it is. Grazi, Hal Helms "Java for CF Programmers" class in Las Vegas, August 18-22 www.halhelms.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ben Forta Sent: Monday, August 04, 2003 5:02 PM To: [EMAIL PROTECTED] Subject: RE: [CFCDev] Overloading CFCs Sean, No, overloading is not going to be supported in Red Sky. Truth is, the whole concept of overloading is a tough one in ColdFusion as CF is typeless. Your best bet is to have a method accept any and all types, and then check to see what the type is in the method and call other code accordingly. --- Ben -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of sean Sent: Monday, August 04, 2003 4:56 PM To: [EMAIL PROTECTED] Subject: RE: [CFCDev] Overloading CFCs Thanks Hal. Do you know if this was fixed in Red Sky? BTW looking forward to your class in LV. Sean -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Hal Helms Sent: Monday, August 04, 2003 4:54 PM To: [EMAIL PROTECTED] Subject: RE: [CFCDev] Overloading CFCs Your terms are right, Sean, but unfortunately, CFCs don't support method overloading. Hal Helms "Java for CF Programmers" class in Las Vegas, August 18-22 www.halhelms.com -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of sean Sent: Monday, August 04, 2003 2:39 PM To: [EMAIL PROTECTED] Subject: [CFCDev] Overloading CFCs Hello All, I apologize in advance as this may be a newbie question. I am currently working with the Mach-ii methodology and was trying to do the following in a CFC. I want to narrow down the error I am getting to either a logic issue on my hand or something in the mach-ii framework. I am basically trying to *overload* the CFC (might be confusing my terms here). That is if the arguments passed to setInfo is a struct, then the second function is called, if a simple numeric value is passed, than the first function is executed. <cffunction name="setInfo" access="public"> <cfargument name="bidAmount" type="numeric" required="true" /> <cfset this.bidAmountD = arguments.bidAmount /> <cfset this.bidMaxAMount = arguments.bidAmount /> <cfset this.bidType = 1/> <cfset this.bidderID = 0 /> <cfset this.targetAuctionID = 97507 /> </cffunction> <cffunction name="setInfo" access="public"> <cfargument name="info" type="query" required="true" /> <cfset this.bidAmountD = arguments.info.bidAmount /> <cfset this.bidMaxAMount = arguments.info.bidMaxAmount /> <cfset this.bidType = arguments.info.bidType /> <cfset this.bidderID = arguments.info.bidderID /> <cfset this.targetAuctionID = arguments.info.targetAuctionID /> </cffunction> Thanks in advance. Sean Scott http://www.kubeworks.com {work} http://www.kubeworks.com/personal {play} ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com). ---------------------------------------------------------- You are subscribed to cfcdev. To unsubscribe, send an email to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev' in the message of the email. CFCDev is run by CFCZone (www.cfczone.org) and supported by Mindtool, Corporation (www.mindtool.com).
