When I stop and think about what the most useful thing that I do in
java that I cant do in flash, it is probably the concept of generics.

I love being able to specify an array of something, where there is
type safety. Of course you could have no safety in flash at runtime
just as you cant in java (erasure) but it is still incredibly
valuable.

Regards
Hank

On 11/3/05, Nicolas Cannasse <[EMAIL PROTECTED]> wrote:
> > ok i see.
> >
> > Another idea which comes to my mind:
> > What about beeing able to specify multiple types for a parameter?
>
> As you shown, multiple types require some kind of discriminating matching.
> I would prefer extend the enum's so they can take parameters :
>
> enum AnyNumber {
>     int( Int );
>     float( Float );
> }
>
> function plusOne( x : AnyNumber )  : AnyNumber {
>     switch x {
>     int(i) => int(i + 1);
>     float(f) => float(f + 1);
>     }
> }
>
> This is not "true" pattern matching yet since there is no recursivity but it
> might be already a nice this way to acheive some dynamic typing and
> polymorphism in a safe-manner.
>
> Nicolas
>
>
> _______________________________________________
> osflash mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/osflash_osflash.org
>

_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org

Reply via email to