Max Blog

My Blog

Don’t lose your keys

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:

  1. first says – don’t you dare to use me in your code in different context as I meant to be
  2. second says – wellll, I am a keyword but only in some context, so do your best
  3. 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:

?View Code ACTIONSCRIPT
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”:

?View Code ACTIONSCRIPT
import my.default.MyClass;

But on the over hand this won’t compile:

?View Code ACTIONSCRIPT
import default.MyClass;

:)

posted by admin in AS3 Creative point of view and have No Comments

Place your comment

Please fill your data and comment below.
Name
Email
Website
Your comment
Before you submit form:
Human test by Not Captcha