ID:1080296
 
Applies to:Dream Maker
Status: Open

Issue hasn't been assigned a status value.
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?
It's called function/method overloading. It's been suggested already and I don't think it'll ever be implemented.
I'm pretty sure you can already do this.
Unfortunately you cannot.

Test
proc
test(var/hello)

test(var/hello, var/world)


Gives

Core\Util\RestrictedNumber.dm:18:error: test: duplicate definition
Core\Util\RestrictedNumber.dm:15:error: test: previous definition
In response to FIREking
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.
In response to Magnum2k
Magnum2k wrote:
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.

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.