What is the value of *self* when the error occurred? The debugger should
show you this.

Another way to determine this is to look at the code and think about where
the sending method is implemented and where the invoked method is
implemented (assuming that there really is one).


On Tue, Sep 1, 2020 at 10:11 AM Roelof Wobben <r.wob...@home.nl> wrote:

> oke, then I would work with hour and minutes as the challenge wanted,
>
> So still on the class side make code that convert any given hour and
>> minute to a valid one ?
>>
>
> Yes. Such code would also be used when doing arithmetic with Times. e.g.
> if you were to implement an instance method named #addMinutes:, its
> implementation would be as simple as ^Time hours: self hours minutes: self
> minutes + anInteger (assuming the argument has that name). The instance
> creation method would normalize the new requested time, just like Time
> hours: 0 minutes: 70 would do.
>
>>
>> Roelof
>>
>>
>
> On some way I think or I do something wrong or I did misunderstood you.
>
>  I did this in Pharo
>
> Object subclass: #Clock
>     instanceVariableNames: 'hour minute'
>     classVariableNames: ''
>     package: 'Exercise@Clock'
>
> I made a asscesors on the instance side.
>
> then I did this on the class side :
>
> hour: anInteger minute: anInteger2
>     self hour: anInteger2 % 60 + anInteger;
>     self minute: anInteger2 / 60;
>     yourself.
>
> but I see a message that hour and minutes are not known.
>
> Roelof
>
>

Reply via email to