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/cfcdev@cfczone.org
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/cfcdev@cfczone.org