2) Coming from C++ I really miss being able to define multiple functions with the same name but different signatures, for example,int foo(int a);int foo(float a);With Dart, I have to write:int foo(Dynamic a)I've seen Dynamic on a lot of places in your library. Almost always it isn't necessary (AFAIK, the only place where Dynamic can be needed is in a list of type arguments when instantiating a generic class) and you can skip the type entirely. In this case, it is totally fine to write int foo(a). If you don't know the return type, you can skip it too (for example, although the main() function has return type of void, I never write it).Just to let you know. The need for runtime checking of argument types of course remains.LT
Am 25.03.2012 17:00 schrieb "A Matías Quezada" <amat...@gmail.com>:
> The only solution I imagine for this is horrible:
>
> interface DomNode {
> add(DomNode|string child);
> }
>
Interesting. Why do you consider this horrible?
I ask because union type is exactly the solution taken by Ceylon, IIRC.
KR
Det
> > The only solution I imagine for this is horrible:
> >
> > interface DomNode {
> > add(DomNode|string child);
> > }
> >
>
> Interesting. Why do you consider this horrible?
> I ask because union type is exactly the solution taken by Ceylon, IIRC.
Yes, this is not horrible at all, if you ask me. However, I think this is unlikely to get into Dart, considering even the absence of generic methods or nullable types (BTW, I tried to implement nullable types in the VM and I've got it somewhat working, will upload the code to GitHub in next few days. Implementing union types would be a little harder, but doable).
LT