Some good ideas. Look at C++, Java, and the Common Lisp Object System
for implementation of the object paradigm.
An object is an object is an object, and here is what (basically) should
included to move an xTalk product away from the object-based (Hypercard,
Metacard) design to the object-oriented design.
Encapsulation - The object should be capable of containing both messages
and methods relative to itself. Messages and methods should have free
access to themselves within the class.
Inheritance - The object should be capable of inheriting the properties,
child objects, and methods of at least one other object.
Access - The object should be able to control access to it's own
messages (inputs, properties, and child parts that allow chain
referencing) and methods (functions) by declaring them as public,
private, or protected. Properties and methods of an
inherited class that are not of type protected can be changed by the
inheriting class.
Persistance - The object should be capable of saving itself between
sessions (by writing itself to a stack persistent object storage area,
for example.)
Usage - The instance of a class is what is used
Obviously, backgrounds, fields, buttons, menus, etc., are examples of
manufacturer-provided objects. I would envision defining the object with
a
new keyword "defineClass" like this:
defineClass className,inheritedClass
public:
inputs: <input-name> .....
properties: <property-name>: <property definition> ...
parts: <part-name> <definition of part to be instantiated>
...
methods: function <name> (<arguments>) <definition> end <name> ...
private:
properties: <property-name>: <property definition> ...
parts: <part-name> <definition of part to be instantiated>
...
methods: function <name> (<arguments>) <definition> end <name> ...
protected:
properties: <property-name>: <property definition> ...
parts: <part-name> <definition of part to be instantiated>
...
methods: function <name> (<arguments>) <definition> end <name> ...
end className
Instantiate via function returning instance of class. If it is a menu,
field, card,
button, background, etc., it has the side effect of appearing on the
screen!
makeInstance (<className>,<input-name> <input-value>,...)
AppleScript already does something like this.
Steve Long
-----------------------------------------------
http://www.isomedia.com/homes/slong