incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Poole <mattjpo...@gmail.com>
Subject Re: AS3 Enhancements: method overloading. Why do people want this?
Date Mon, 16 Jan 2012 15:46:20 GMT
You can always just use a custom namespace to acieve overloading. e.g.

namespace addString;
namespace addNumber;

addString function Sum(a:String,b:String):String
{
return a+b;
}

addNumber function Sum(a:Number,b:Number):Number
{
return a+b;
}

On 16 January 2012 15:33, Rui Silva <flex@rduartes.net> wrote:

>
> > From: "Martin Heidegger" <mh@leichtgewicht.at>
> > (...) Also
> > the if checks for the type cost performance.
> >
> > yours
> > Martin.
> >
>
> I believe that the example stated there were no difference in the code that
> sent any of the types. If that was not the case, I'd keep the descriptive
> long method names.
>
> Agree on the type safety when you use *, but I would only use that when any
> type is absolutely admissible, or I'd keep the descriptive long method
> names.
>
> Rui
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message