*lol* The same way the underlying technology does it....



On 5/4/07, Sammy Larbi <[EMAIL PROTECTED]> wrote:

Sorry for the confusion Arron, I meant that question to be more like
"how would you implement /actual/ method overloading" in CF itself. =)


Aaron DC wrote, On 5/4/2007 8:14 AM:
> I would implement it exactly the same way I did in the code I emailed
> to the list 1-2 hours ago. With the function I defined, you can call
> save() like so:
>
> save(somestruct)
> save(somestruct, arg1)
> save(somestruct, arg1, arg2)
>
> save(someobject)
> save(someobject, arg1)
> save(someobject, arg1, arg2)
>
> If you want to make the arguments required, test for their existence
> and generate an error.
> Aaron
>
> Sammy Larbi wrote:
>> Aaron DC wrote, On 5/4/2007 7:26 AM:
>>> If you can simulate it (as in the example I just showed), does it
>>> really matter if it makes it into CF8?
>>>
>>> Aaron
>>>
>>> Andrew Scott wrote:
>>>> +1...
>>>>
>>>> I agree, it would so good if we could create methods with different
>>>> arguments. I have flagged this as a wish, so I doubt it will make
>>>> CF8... But who knows...
>>>>
>>
>> And how would you implement it?  I see three choices:
>> 1) require named arguments, and distinguish on the name
>> 2) require typed arguments, and distinguish on the type
>> 3) keep the option of naming/typing arguments, and only require it if
>> attempting to overload a method (throwing an error if, when using the
>> method, someone forgets to name arguments, if that is chosen.
>>
>> Don't forget, we also have optional arguments, so you can use that
>> for "overloading" too...
>>
>> -Sam
>>
>>
>>
>> You are subscribed to cfcdev. To unsubscribe, please follow the
>> instructions at http://www.cfczone.org/listserv.cfm
>>
>> CFCDev is supported by:
>> Katapult Media, Inc.
>> We are cool code geeks looking for fun projects to rock!
>> www.katapultmedia.com
>>
>> An archive of the CFCDev list is available at
>> www.mail-archive.com/[email protected]
>>
>>
>>
>
>
> You are subscribed to cfcdev. To unsubscribe, please follow the
> instructions at http://www.cfczone.org/listserv.cfm
>
> CFCDev is supported by:
> Katapult Media, Inc.
> We are cool code geeks looking for fun projects to rock!
> www.katapultmedia.com
>
> An archive of the CFCDev list is available at
> www.mail-archive.com/[email protected]
>
>
>



You are subscribed to cfcdev. To unsubscribe, please follow the
instructions at http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]




--



Senior Coldfusion Developer
Aegeon Pty. Ltd.
www.aegeon.com.au
Phone: +613  8676 4223
Mobile: 0404 998 273


You are subscribed to cfcdev. To unsubscribe, please follow the instructions at 
http://www.cfczone.org/listserv.cfm

CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com

An archive of the CFCDev list is available at 
www.mail-archive.com/[email protected]

Reply via email to