WorldMorph subclass: PasteUpMorph?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

WorldMorph subclass: PasteUpMorph?

K K Subbu
Hi,

Is there any specific reason why WorldMorph is not a subclass of
PasteUpMorph? The latter uses a variable to hold significant world state
and rest of Morphic use isWorldMorph to check the type before calling
methods.

I would have expected subclassing and double-dispatch to yield smaller
and cleaner code.

Regards .. Subbu

Reply | Threaded
Open this post in threaded view
|

Re: WorldMorph subclass: PasteUpMorph?

Hannes Hirzel
Hi Subbu

Squeak 2.4 had a WorldMorph class as a subclass of PasteUpMorph.
But Squeak 2.4 had no WorldState class..

In Squeak 2.5 a WorldState class was introduced and the WorldMorph
class was removed.

Squeak 2.5 has

    PasteUpMorph
    isWorldMorph

        ^ worldState notNil

Pharo (a fork of 3.8 or 3.9?) then later introduced WorldMorph as a
subclass of PasteUpMorph.

More research is need ......

Regards
Hannes



On 5/10/17, K K Subbu <[hidden email]> wrote:

> Hi,
>
> Is there any specific reason why WorldMorph is not a subclass of
> PasteUpMorph? The latter uses a variable to hold significant world state
> and rest of Morphic use isWorldMorph to check the type before calling
> methods.
>
> I would have expected subclassing and double-dispatch to yield smaller
> and cleaner code.
>
> Regards .. Subbu



WorldMorph_as_subclass_of_PasteUpMorph_in_Squeak2.4.png (18K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: WorldMorph subclass: PasteUpMorph?

K K Subbu
On Wednesday 10 May 2017 08:35 PM, H. Hirzel wrote:
> Hi Subbu
>
> Squeak 2.4 had a WorldMorph class as a subclass of PasteUpMorph.
> But Squeak 2.4 had no WorldState class..
>
> In Squeak 2.5 a WorldState class was introduced and the WorldMorph
> class was removed.

http://wiki.squeak.org/squeak/715 (WorldMorph) seem to hint that it was
done to support nested worlds (as in projects), but has no explanation.

http://wiki.squeak.org/squeak/1818 (WorldState) states that it was
created to implement world functions for pasteups which respond true to
isWorldMorph.

Both entries are silent on the rationale behind the change. What are the
pros and cons of WorldState vs WorldMorph approaches? Is the close ties
to hardware elements (screen, HID events, ..) a major factor?

Regards .. Subbu