ID:1080296
![]() Dec 9 2012, 5:48 am
|
|||||||
| |||||||
One thing that I really appreciated about java is that I could have the same function name for more than 1 definition, I just needed different arguments. Would it be feasible to add this to DM?
|
![]() Dec 9 2012, 6:05 am
|
|
It's called function/method overloading. It's been suggested already and I don't think it'll ever be implemented.
|
Unfortunately you cannot.
Test Gives Core\Util\RestrictedNumber.dm:18:error: test: duplicate definition |
FIREking wrote:
I'm pretty sure you can already do this. Of course you can, using work-arounds. You can't, however, explicitly overload a function because you'll get a "duplicate" definition error. |
Magnum2k wrote:
FIREking wrote: Ah yes, it seems the want you to just use named parameters in these situations, and then you write your proc's to contain all the arguments you'll ever want to use. |