What are prototypes and how would they be used in Squeak?
There are a number of object models. Smalltalk has a "class-instance" model, which means that one creates a class (object) which has the shared code (methods) and meta-data (e.g. instance slot information) used to "create instances of the class". You have to create a class before making an instance (object).
In a Prototype based OO system, objects are thought of as having both state (instance variables) AND behavior (methods). When you want to create a 'child' of an object you can clone it and then change both its state and behavior without modifying its 'parent'. Depending on the OO model, changes to the 'parent' may or may not show up in the 'child'. In a "pure" Prototype model changes to the 'parent' do NOT show up in the child. In practice one may allow a user to have either behavior as desired.
What is this other model good for? It has been used to advantage in multimedia authoring where there are a lot of idiosyncratic objects. When you want to create a singleton object, why should you have to create a separate class?
Apple had a long-running multi-media authoring project called 'SK8' (pronounced 'skate') which looked at a lot of user/developers to see how people worked and thought about authoring. They ended up with a very interesting Prototype model. A problem with the current Squeak environment is that when a new user appears, he/she is essentially told "go learn the class libraries and then you can build something". With SK8, one gets a bunch of tool pallets and can do "drag 'n drop" authoring. I.e. grab and plunk down media and then "shift-click" on the visual elements to see/change their property sheet and add behaviors. There is also an "English-like" language which is fairly intuitive.
E.g.
on MouseDown of me set my fillColor to Green play pingSound set my fillColor to Red tell CharlieRectangle to play myQuickTimeMovie end
set the fillColor of every Rectangle on the Stage to mySpecialRenderer
See: http://sk8.research.apple.com/sk8/sk8.html Note especially: http://sk8.research.apple.com/sk8/editors.html
Unfortunately, SK8 only runs on Macs. I am certainly interested (as I suspect are others) in using Squeak to build a SK8-like development environment and Prototypes would be a big help. Now as soon as Squeak & Morphics get a bit more stable..
Cheers, -Ken
I've tried forking processes and not had happy results. In summary, I want to have something running in the background, updating a screen. When I use
[ relevantcode] forkAt: Processor userBackgroundPriority
the process seems to get cycles only *very* rarely (it would sometimes be dozens of seconds before the process got cycles). This happens on both Win95 and Solaris, and even though nothing else is happening. I tried very simple cases of just having the background process send lines to the transcript, and got the same behavior.
Is there something to know about here?
-- kurt
squeak-dev@lists.squeakfoundation.org