incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Heidegger ...@leichtgewicht.at>
Subject Re: AS3 Enhancements: method overloading. Why do people want this?
Date Mon, 16 Jan 2012 15:25:37 GMT
Typing a function like

public function send(value:*): void{}

removes auto-completion in the IDE and type-safety during compilation. 
Furthermore if you want to code it out
you better throw an exception creating potential error-prone code. Also 
the if checks for the type cost performance.

yours
Martin.

On 17/01/2012 00:09, David Arno wrote:
>> From: Nicholas Kwiatkowski [mailto:nicholas@spoon.as]
>> Sent: 16 January 2012 15:02
>> public function sendAsString(stringToSend:String):bool
>> public function sendAsBool(boolToSend:Boolean):bool
>> public function sendAsArray(arrayToSend:Array):bool
>> public function sendAsInt(intToSend:int):bool ...
> Could you not just have:
>
> public function send(value:*):Boolean
>
> instead?
>
> David.
>
>


Mime
View raw message