The most important things that are missing for an OOP language in AS is:
- Not everything is an Object.
- There is no such thing as late bindings
- You’re not able to write a class (as a result subclassing is not possible). Script objects can give you an OOP feel but they’re objects (a data collection) and not classes.
- Interfaces
- Abstract classes
- Delegates, prototyping or Function pointers are missing
Great example of how to use the load script example (reminds me of writing AS-Studio code). The drawbacks in these days was a missing constructor, which misses in ObjC as well. You had to agree, with yourself, to use a consistent handler to be called after loading. Then, how do you handle requirements? For instance I have an shell object, mysql object and a regex object. I want the shell object to be a singleton but both mysql and regex needs to use the shell object and are instantiated. My solution to all of this, when I wrote AppleScript Studio, was loading all script objects at launch and define them as globals. Well everything is a singleton and every singleton have some class like features. To instantiate the singleton returns a small object with the singleton as it’s parent Read this and you can see that Shane’s solution is similar to a singleton while mine instantiates, both have their pro’s and cons.