[Cuis-dev] Object wantsSteps

Alexandre Rousseau yalexr at gmail.com
Mon Mar 27 05:51:39 PDT 2023


Thanks! I feel though that threads could be overkill for my needs (I'm
probably biased as an Elixir -- light processes etc -- dev) ?

- I have a TrafficLightFSM (cycling through, say, #red #green #yellow
states).
- This fsm aka model is observed by a TrafficLightMorph, a
WalkPrompterMorph, a CountdownMorph, and others.
- I would like to keep the timing of transitions from one state to the next
inside the model.

Creating/finding a TimerMorph acting as controller of my model could work,
but I was wondering if there was a canonical way for such needs.

ps: gotta love Smalltalk ... so pleasant + easy to work with (and to shoot
oneself in the foot :) .



On Mon, Mar 27, 2023 at 7:44 AM Hernán Wilkinson <
hernan.wilkinson at 10pines.com> wrote:

> Those messages are part of the Morph framework.
> They do not work on regular objects, I do not know why they are defined in
> Object, perhaps a legacy reason.
> If you want to send messages at regular intervals, create a thread to do
> it using the message #fork or similar (look at BlockClosure class)
>
> Cheers
> Hernan.
>
> On Mon, Mar 27, 2023 at 12:18 AM Alexandre Rousseau via Cuis-dev <
> cuis-dev at lists.cuis.st> wrote:
>
>> I'd like my Object's subclass instances to send messages at regular
>> intervals.
>>
>> I see that Object defines the #wantsSteps and #stepAt: selectors, but I
>> can't find examples of usage.
>>
>> Does anyone have anything on this?
>>
>> Thanks
>>
>> --
>> Cuis-dev mailing list
>> Cuis-dev at lists.cuis.st
>> https://lists.cuis.st/mailman/listinfo/cuis-dev
>>
>
>
> --
>
> *Hernán WilkinsonAgile Software Development, Teaching & Coaching*
> *Phone: +54-011*-4893-2057
> *Twitter: @HernanWilkinson*
> *site: http://www.10Pines.com <http://www.10pines.com/>*
> Address: Alem 896, Floor 6, Buenos Aires, Argentina
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230327/98abd756/attachment.htm>


More information about the Cuis-dev mailing list