Morphforge.

diegogomezdeck at consultar.com diegogomezdeck at consultar.com
Fri May 23 09:35:31 UTC 2003


Hi Alan,

[snip]
> Viewer excells at pushing polygons around the display but I have not
> found a way to use it to generate _CLASSES_.
>
> Since I'm too lame to figure out how to generate layouts with the
> existing tools... (And judging how varrious things that shouldn't be
> resizable in Browser are, it appears that everybody just gets it
> GoodEnuff and leaves it that way...)
>
> The idea is to put an item somewhere in one of the halos, "enable
> authoring mode".
>
> So when you grab a rectangle out of the parts bin, and enable this
> setting, it will open a browser and prompt you to enter a new class
> name (with appropriate safety precautions.)
>
> When you take another rectangle out of the bin and drop it into the
> first, it will _AUTOMATICLY_ add whatever code it takes to put that
> rectangle there whenever the class is started... In this fassion _ALL_
> possible layout options should be recorded... If you set the corners to
> rounded, the authoring mode should add this to the new class... (A good
> example from the immage is SameGame morph which, by default, loads with
> square corners but the instance in the image has round corners. --
> Apparently it is too much of a bother to update the class...)
>
> The generated code should add to the new class all code necessary to
> communicate with the embedded morph and instead of having to hunt down
> the methods for handling events, there should be an option to check off
> the events you want to handle and the method-stubs should be added to
> the appropriate classes automaticly. ;)
>
> This approach might have some limitations in cases where you _WANT_ a
> behavior to change dynamicly but in general this approach _SHOULD_ work
> fairly well for the majority of cases...
>
> In general, its really cool that Squeak can have "mutant instances" but
> it won't really be useful unless it can be used to mutate classes as
> well.
>
> Am I cool enough to implement this myself? Not yet... =(
>
> The text above should be more than proof that I am hopelessly lazy. ;)

Code generation is not a good idea.  I prefer to switch to a more-prototype
way.  To say it shortly: I found much more powerful the model behind Parts.

- The objects you're manipulating create the prototype from where we'll
copy different "instances" of your objects.
- The behaviour (aka code) you put on these objects have to be instance-
base behaviour and not class base.

To do that we need to modify [1] the VM to support instance base behaviour
in an efficient way.

See:
  http://groups.yahoo.com/group/squeak/message/53711
  http://groups.yahoo.com/group/squeak/message/59753

Cheers,

Diego


[1] Any VM hacker can estimate the effort to modify the VM in this way?





More information about the Squeak-dev mailing list