Every programming language has keywords and AS3 has lots of those. They are even categorized in three groups. Have a look at my favorite website but now under the topic: Keywords and reserved words
You see three categories:
- first says – don’t you dare to use me in your code in different context as I meant to be
- second says – wellll, I am a keyword but only in some context, so do your best
- third says – I am not a keyword, but I could be – don’t you touch me
So, our conclusions – this code is ugly but correct:
function get get():int { return 0; } var namespace : Namespace; |
Another logical conclusion from the first group is that packages should not be named as keywords. Because if you have a class in such a package than a keyword will appear in your code as identifier in an import statement. Sadly logic is relative from creative point of view. You can name a sub package “default”:
import my.default.MyClass; |
But on the over hand this won’t compile:
import default.MyClass; |