Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't ActionScript have "generics"?

Tags:

Can anyone tell me why ActionScript 3, a statically typed language, doesn't have generics? Is it too much work? A historical thing? Is there some way to "fake" it that I haven't picked up yet?

Edit: thanks a lot for the answers! The Vector class is basically what I was looking for, and the other information was helpful too.

like image 789
David Wolever Avatar asked May 11 '09 14:05

David Wolever


People also ask

Is ActionScript still relevant?

ActionScript is basically a dialect of JavaScript (which is also called ECMAScript). So you can still use it.

Is ActionScript 3 still used?

While originally designed for Adobe Flash Player, ActionScript 3 may be used by developers today to build plugin-free, cross-platform, web applications with Apache Royale.

Is ActionScript same as JavaScript?

ActionScript is very similar to JavaScript, except it is built solely for interacting with Flash applications. These are usually videos or small interactive modules inside web pages. Many of them use Flash.

What is a class in ActionScript?

Classes are external ActionScript files that define objects; they are stored and organized in a specific directory structure in the Flash CS3 program directory (Figure 4.1). To use them in your code, you have to import them.


1 Answers

The new Vector class is a form of generics that Actionscript 3 now supports when compiled for Flash Player 10. They don't support the specification of your own generic classes, yet.

I think Adobe will implement the ES4 standard eventually. It would be nice if they had a competitor who could push them quicker in the right direction. I was expecting a little more from the updates to AS3 when they moved to CS4, but I suppose the revolutionary Vector class will have to suffice.

It looks like they spent a lot of time beefing up the libraries for Flex and AIR, so maybe they'll go back to improving the language support later, but it probably isn't a real priority. Remember, Adobe is in it for the money, not for the feel good of making the sweetest possible language.

like image 57
Kekoa Avatar answered Oct 06 '22 05:10

Kekoa