Ok well one will fix ProfStef one day, probably before the Pharo 3.0
release.
To insert this code in your image and finish ProfStef, open the class
browser (right click on the background, then class browser is the first
context menu item), then right-click on the packages (left list), click on
'find class...', write 'Object' or 'ProfStef', press enter, then add a
method with exactly this code (copy and past it):
*executeMethod*: method
^ self withArgs: #( ) executeMethod: method
Then ProfStef should work. Updating ProfStef was in the TODO list for Pharo
2 summer release, but I guess one forgot this method.
For Time now, you have:
Time now printString ===>>> print in 12h mode
Time now print24 ===>>> print in 24h mode
The object is the same, just the printing method is different.
By the way, a quick trick, when you look for senders or implementors or a
message, write the selector anywhere, highlight it with your mouse, then
right-click on it, click 'extended search...', then click 'senders of it
...' or 'implementors of it ...' so you can know directly who
implements/sends this message without looking into all the class in the
class browser. It helps a lot understanding code.
Pharo by example is good with Pharo 1.4. More recent version of Pharo may
be a little different from what is in the book, however most of it should
be very similar. The new book, Deep into Pharo is up to date with Pharo 3.0
but covers only advanced aspects of Pharo.
Enjoy working with Pharo :)
2013/10/27 Charles Hixson <[email protected]>
> Hello,
> Thanks for the response. However being as I'm of the level of experience
> where using profStef it's probably a poor idea for me to even TRY to fix
> things. I may be an experienced programmer, but my level of Smalltalk
> knowledge is such that I'm only guessing at what you mean. I can't
> actually read the code you wrote. And I wouldn't know how to even insert
> it in my local image. (I finished the tutorial, but it wasn't covering the
> language to that depth. And Pharo by Example keeps describing things that
> don't match what I see on my screen. Often I can figure out what is meant,
> but sometimes there doesn't seem to be anything that does the same job.
> (E.g., I haven't figured out how to get "Time now." to report in 24hour
> time.)
>
> I THINK that this should be changed in profStef rather than in Object,
> probably by removing the reference. But that's just a guess. (That much I
> can do in my image, but I wouldn't want to do it in any shared code without
> someone a LOT more knowledgeable saying it's a good idea, and watching over
> my shoulder.)
>
>
> On 10/26/2013 10:56 PM, Clément Bera wrote:
>
> Hello,
>
> I think #executeMethod was a shortcut for method without arguments of the
> method #withArgs:executeMethod:. I missed it too, so I guess you can add a
> bug report, create and commit a slice and lastly it will be integrated in
> Pharo in the next few days.
>
> #withArgs:executeMethod: is implemented in ProtoObject, but we take care
> not to have too many methods there. This kind of facilities are usually in
> Object (For example, #isNil is in ProtoObject, but #notNil which is a
> facility for 'isNil not' is in Object). So I guess what you miss is:
>
> Object>>*executeMethod*: method
> ^ self withArgs: #( ) executeMethod: method
>
> Best,
>
>
>
> 2013/10/26 Charles Hixson <[email protected]>
>
>> I'm using:
>>
>> Pharo2.0
>> Latest update: #20625
>>
>> I'm at "Reflection continued
>>
>> When I do the command to go to the next lesson:
>> ProfStef default executeMethod: (ProfStef lookupSelector:#next).
>>
>> I get the error:
>> ProfStef(Object) doesNotUnderstand: #executeMethod
>>
>> When I browse to the class in the system browser, ProfStef doesn't have
>> an executeMethod object.
>> I also checked Object and ProtoObject,just to be sure, but neither of
>> them listed an executeMethod either.
>>
>> P.S.: I also looked at the Class Methods, though default looks like it
>> returns an instance, so that didn't feel reasonable.
>>
>> Where is executeMethod supposed to reside, and was this an intentional
>> change that just hasn't propagated yet ('m guessing the removal of the
>> method) or is something wrong with my image? Also, if I wanted to include
>> it into ProfStef, what would the method look like?
>>
>> --
>> Charles Hixson
>>
>>
>>
>
>
> --
> Charles Hixson
>
>