Re: [Pharo-users] Updated Pharo By Example

2015-10-16 Thread Lyn Headley
[I have submitted the following issue but am posting here for the sake of
discussion]

Pharo is used by software developers, and software developers depend on
packages. Therefore I believe that one of the first things a new Pharo user
will want to do is install packages written by others. But Pharo By Example
contains no mention of the ConfigurationOfXYZ method of installing packages
(and does not mention the configuration browser -- an awesome tool for new
users to get excited about what is out there). You could introduce these
topics without getting too deep into Metacello, but...

I also think Metacello should be introduced fairly early. Any application
will almost certainly have dependencies and it is important to be able to
load your application into a fresh image. Metacello is essential for this,
so it is essential for Pharo.

Chapter 8 could probably be expanded to include these topics, which are
more fundamental than Morphic or Seaside. Note that the Seaside chapter
recommends installing an old one-click image! This is a great chance to use
Configurations.

What do you think of this idea? And yes, I realize I can contribute this
myself, but I currently decline the commitment.

Lyn

On Thu, Oct 15, 2015 at 5:42 AM, Dimitris Chloupis 
wrote:

> First of all thanks to all the people helping with the documentation.
>
> Now I think its the time to replace the old PBE with UPBE , we dont need
> to change the website just link to the newest pdf here
>
>
> https://ci.inria.fr/pharo-contribution/view/Books/job/UpdatedPharoByExample/lastSuccessfulBuild/artifact/book-result/UpdatedPharoByExample.pdf
>
> Because UPBE at this moment is light years ahead of PBE. I just added doc
> for Spotter, Dark Theme, and the new Nautilus icons.
>
> If any of you wants to fix something on UPBE and does not have the
> confidence to do it directly , because you dont understand Pillar or you
> dont feel confident yet with Pharo you can still help me tremendously by
> adding your comment , your corrected text or your addition documentation as
> github issue here and I will put it in the book ASAP.
>
> https://github.com/SquareBracketAssociates/UpdatedPharoByExample/issues
>
> I will be resolving at least one issue per week from now on to make sure
> that UPBE is being pushed forward and remains by far the most up to date
> documentation of Pharo anywhere in this universe. But I cannot guarantee
> for other universes.
>
> So please help , even a tiny bit of help is great because we can all make
> Pharo far easier for newcomers with much better documentation and expand
> UPBE to every direction.
>
> All hail Pharo !
>


Re: [Pharo-users] Renaming a Class triggers debugger

2015-10-14 Thread Lyn Headley
Hi Ben,

Thanks for looking into this. I've gone through your steps on my
machine (the image filename is Pharo-40622.image so I assume that is a
build number) and I get the same error you do. As you say, the errors
are not identical but hopefully this will lead to a fix for both. For
continuing my work, I am going to install a fresh image, and hopefully
I can still rename classes as long as there are no MessageBrowsers
open. I'd be interested in hearing other workarounds.

Lyn

On Wed, Oct 14, 2015 at 7:01 AM, Ben Coman  wrote:

> That sounds like a reasonable choice.  Anyhow, with build 50384 I can
> reproduce a similar error as follows...
>
> 1. Open fresh image.
> 2. World > Tools > Recent Messages
> 3. World > System Browser
> 4. Package pane > Add package > "AAPackage"
> 5. Class pane > Add class > "AAClass"
> 6. Protocol pane > no messages
> 7. Code pane > replace template with "test1" and save
> 8. Class pane > right-click "AAClass" > Rename > "AAClass2" > Ok
> 9. Code pane > replace "test1" with "test2" and save
>
> which produces...
>
> UndefinedObject(Object)>>doesNotUnderstand: #timeStamp
> RGMethodDefinition>>stamp
> [ self class parseTimestampFrom: self stamp default: DateAndTime epoch
> ] in RGMethodDefinition>>timeStamp
> [ self at: key put: aBlock value ] in
> IdentityDictionary(Dictionary)>>at:ifAbsentPut:
> IdentityDictionary(Dictionary)>>at:ifAbsent:
> IdentityDictionary(Dictionary)>>at:ifAbsentPut:
> RGMethodDefinition(RGDefinition)>>annotationNamed:ifAbsentPut:
> RGMethodDefinition>>timeStamp
> [ :a :b | a timeStamp > b timeStamp ] in RecentMessageList>>open
> Array(SequenceableCollection)>>mergeFirst:middle:last:into:by:
> Array(SequenceableCollection)>>mergeSortFrom:to:src:dst:by:
> OrderedCollection>>sort:
> OrderedCollection(SequenceableCollection)>>sorted:
> MultiColumnListModel(ListModel)>>items:
> MessageBrowser>>messages:
> ...
> WorldMorph>>doOneCycle
>
> So thanks Lyn, you found a bug.  Did you get this same error, or just
> similar?  Anyhow, it may be the same root cause.
>
> However I didn't create an issue in the tracker yet, since I wasn't
> sure what the title should be... anyone?
>
> cheers -ben
>
> On Wed, Oct 14, 2015 at 10:27 AM, Lyn Headley  wrote:
> > Because Pharo 4 is the latest release. Do I really have to defend this
> > choice?
> >
> > On Tue, Oct 13, 2015 at 2:32 PM, Alexandre Bergel <
> alexandre.ber...@me.com>
> > wrote:
> >>
> >> I have no idea. But why don’t you move to Pharo 5?
> >>
> >> Cheers,
> >> Alexandre
> >>
> >>
> >> > On Oct 13, 2015, at 4:36 PM, Lyn Headley  wrote:
> >> >
> >> > Hello,
> >> >
> >> > I'm running pharo 4 and I'm having a problem. I recently renamed a
> >> > class using the rename: menu item in the standard system browser (I
> >> > believe it's called Nautilus) and now I am getting uncaught exceptions
> >> > whenever I add or remove a method (three debugger windows pop
> >> > up). Here is the stack trace; any advice?
> >> >
> >> > Thank you.
> >> >
> >> > Lyn
> >> >
> >> > Author: LynHeadley
> >> > Date: 2015-10-13T08:51:16.837987-07:00
> >> >
> >> > UndefinedObject(Object)>>doesNotUnderstand: #theMetaClass
> >> > RGMetaclassDefinition>>realClass
> >> > RGMethodDefinition(RGElementDefinition)>>realParent
> >> > RGMethodDefinition(RGElementDefinition)>>realClass
> >> > RGMethodDefinition>>methodClass
> >> > ByteSymbol(Symbol)>>value:
> >> > OrderedCollection>>collect:
> >> > MessageBrowser>>buildHierarchyForMessages:
> >> > MessageBrowser>>cacheHierarchyForClasses:
> >> > MessageBrowser>>messages:
> >> > [
> >> > (item methodClass notNil and: [ item methodClass isObsolete not ])
> >> >   ifTrue: [
> >> >   | sel text boolean |
> >> >   boolean := textModel hasUnacceptedEdits.
> >> >   boolean
> >> >   ifTrue: [ text := textModel pendingText ].
> >> >   sel := listModel selectedItem.
> >> >   self
> >> >   messages:
> >> >   (listModel listItems
> >> >   add: item asFullRingDefinition;
> >> >   yourself).
> >> >   listModel setSelectedItem: sel.
> >> >   boolean
> >> >   ifTrue: [ textModel pendingText: text ] ] ] in
> >> > MessageBrowser>>methodAdded:
> >> > WorldState>>runStepMethodsIn:
> >> > WorldMorph>>runStepMethods
> >> > WorldState>>doOneCycleNowFor:
> >> > WorldState>>doOneCycleFor:
> >> > WorldMorph>>doOneCycle
> >> > [
> >> > [
> >> > World doOneCycle.
> >> > Processor yield.
> >> > false ] whileFalse: [  ] ] in MorphicUIManager>>spawnNewProcess
> >> > [
> >> > self value.
> >> > Processor terminateActive ] in BlockClosure>>newProcess
> >> >
> >>
> >> --
> >> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> >> Alexandre Bergel  http://www.bergel.eu
> >> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
> >>
> >>
> >>
> >>
> >
>
>


Re: [Pharo-users] Renaming a Class triggers debugger

2015-10-13 Thread Lyn Headley
Because Pharo 4 is the latest release. Do I really have to defend this
choice?

On Tue, Oct 13, 2015 at 2:32 PM, Alexandre Bergel 
wrote:

> I have no idea. But why don’t you move to Pharo 5?
>
> Cheers,
> Alexandre
>
>
> > On Oct 13, 2015, at 4:36 PM, Lyn Headley  wrote:
> >
> > Hello,
> >
> > I'm running pharo 4 and I'm having a problem. I recently renamed a
> > class using the rename: menu item in the standard system browser (I
> > believe it's called Nautilus) and now I am getting uncaught exceptions
> > whenever I add or remove a method (three debugger windows pop
> > up). Here is the stack trace; any advice?
> >
> > Thank you.
> >
> > Lyn
> >
> > Author: LynHeadley
> > Date: 2015-10-13T08:51:16.837987-07:00
> >
> > UndefinedObject(Object)>>doesNotUnderstand: #theMetaClass
> > RGMetaclassDefinition>>realClass
> > RGMethodDefinition(RGElementDefinition)>>realParent
> > RGMethodDefinition(RGElementDefinition)>>realClass
> > RGMethodDefinition>>methodClass
> > ByteSymbol(Symbol)>>value:
> > OrderedCollection>>collect:
> > MessageBrowser>>buildHierarchyForMessages:
> > MessageBrowser>>cacheHierarchyForClasses:
> > MessageBrowser>>messages:
> > [
> > (item methodClass notNil and: [ item methodClass isObsolete not ])
> >   ifTrue: [
> >   | sel text boolean |
> >   boolean := textModel hasUnacceptedEdits.
> >   boolean
> >   ifTrue: [ text := textModel pendingText ].
> >   sel := listModel selectedItem.
> >   self
> >   messages:
> >   (listModel listItems
> >   add: item asFullRingDefinition;
> >   yourself).
> >   listModel setSelectedItem: sel.
> >   boolean
> >   ifTrue: [ textModel pendingText: text ] ] ] in
> MessageBrowser>>methodAdded:
> > WorldState>>runStepMethodsIn:
> > WorldMorph>>runStepMethods
> > WorldState>>doOneCycleNowFor:
> > WorldState>>doOneCycleFor:
> > WorldMorph>>doOneCycle
> > [
> > [
> > World doOneCycle.
> > Processor yield.
> > false ] whileFalse: [  ] ] in MorphicUIManager>>spawnNewProcess
> > [
> > self value.
> > Processor terminateActive ] in BlockClosure>>newProcess
> >
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>


Re: [Pharo-users] Renaming a Class triggers debugger

2015-10-13 Thread Lyn Headley
Hi Nicolai,

I had a bunch of messagebrowsers open, mostly on various classes of Morphic
and Montecello packages; nothing that was related to the class I renamed.
Since I got your message I have closed the MessageBrowsers, and now there
are only two debuggers triggered when I add or remove a method :-)

It looks like WorldState's queue of deferredUIMessages contains a stale
block or something...

runStepMethodsIn: aWorld
"Perform periodic activity inbetween event cycles"
| queue nextInQueue|
"If available dispatch some deferred UI Message"
queue := self class deferredUIMessages.
[(nextInQueue := queue nextOrNil) isNil]
whileFalse: [ nextInQueue value <- error ].
self runLocalStepMethodsIn: aWorld.
"The multi-threaded global Transcript needs to be updated periodically and
synchronously with the UI."
Transcript stepGlobal.

On Tue, Oct 13, 2015 at 2:52 PM, Nicolai Hess  wrote:

> Hi Lyn
>
> 2015-10-13 21:36 GMT+02:00 Lyn Headley :
>
>> Hello,
>>
>> I'm running pharo 4 and I'm having a problem. I recently renamed a
>> class using the rename: menu item in the standard system browser (I
>> believe it's called Nautilus) and now I am getting uncaught exceptions
>> whenever I add or remove a method (three debugger windows pop
>> up). Here is the stack trace; any advice?
>>
>
> The error is from the MessageBrowser, the MessageBrowser registers itself
> for every class change (method added/removed) and tests if this added /
> removed
> message should be removed/added to its lists.
>
> Do you have any MessageBrowser open ?
> - a sendersOf or implementorsOf
> - if so,  what search term is used in the browser (see window title)
>
> I tried to recreate this error but all I could get was a MessageBrowser
> with
> "nil" entries - no exception was thrown.
>
>
>>
>> Thank you.
>>
>> Lyn
>>
>> Author: LynHeadley
>> Date: 2015-10-13T08:51:16.837987-07:00
>>
>> UndefinedObject(Object)>>doesNotUnderstand: #theMetaClass
>> RGMetaclassDefinition>>realClass
>> RGMethodDefinition(RGElementDefinition)>>realParent
>> RGMethodDefinition(RGElementDefinition)>>realClass
>> RGMethodDefinition>>methodClass
>> ByteSymbol(Symbol)>>value:
>> OrderedCollection>>collect:
>> MessageBrowser>>buildHierarchyForMessages:
>> MessageBrowser>>cacheHierarchyForClasses:
>> MessageBrowser>>messages:
>> [
>> (item methodClass notNil and: [ item methodClass isObsolete not ])
>> ifTrue: [
>> | sel text boolean |
>> boolean := textModel hasUnacceptedEdits.
>> boolean
>> ifTrue: [ text := textModel pendingText ].
>> sel := listModel selectedItem.
>> self
>> messages:
>> (listModel listItems
>> add: item asFullRingDefinition;
>> yourself).
>> listModel setSelectedItem: sel.
>> boolean
>> ifTrue: [ textModel pendingText: text ] ] ] in
>> MessageBrowser>>methodAdded:
>> WorldState>>runStepMethodsIn:
>> WorldMorph>>runStepMethods
>> WorldState>>doOneCycleNowFor:
>> WorldState>>doOneCycleFor:
>> WorldMorph>>doOneCycle
>> [
>> [
>> World doOneCycle.
>> Processor yield.
>> false ] whileFalse: [  ] ] in MorphicUIManager>>spawnNewProcess
>> [
>> self value.
>> Processor terminateActive ] in BlockClosure>>newProcess
>>
>>
>


[Pharo-users] Renaming a Class triggers debugger

2015-10-13 Thread Lyn Headley
Hello,

I'm running pharo 4 and I'm having a problem. I recently renamed a
class using the rename: menu item in the standard system browser (I
believe it's called Nautilus) and now I am getting uncaught exceptions
whenever I add or remove a method (three debugger windows pop
up). Here is the stack trace; any advice?

Thank you.

Lyn

Author: LynHeadley
Date: 2015-10-13T08:51:16.837987-07:00

UndefinedObject(Object)>>doesNotUnderstand: #theMetaClass
RGMetaclassDefinition>>realClass
RGMethodDefinition(RGElementDefinition)>>realParent
RGMethodDefinition(RGElementDefinition)>>realClass
RGMethodDefinition>>methodClass
ByteSymbol(Symbol)>>value:
OrderedCollection>>collect:
MessageBrowser>>buildHierarchyForMessages:
MessageBrowser>>cacheHierarchyForClasses:
MessageBrowser>>messages:
[
(item methodClass notNil and: [ item methodClass isObsolete not ])
ifTrue: [
| sel text boolean |
boolean := textModel hasUnacceptedEdits.
boolean
ifTrue: [ text := textModel pendingText ].
sel := listModel selectedItem.
self
messages:
(listModel listItems
add: item asFullRingDefinition;
yourself).
listModel setSelectedItem: sel.
boolean
ifTrue: [ textModel pendingText: text ] ] ] in MessageBrowser>>methodAdded:
WorldState>>runStepMethodsIn:
WorldMorph>>runStepMethods
WorldState>>doOneCycleNowFor:
WorldState>>doOneCycleFor:
WorldMorph>>doOneCycle
[
[
World doOneCycle.
Processor yield.
false ] whileFalse: [  ] ] in MorphicUIManager>>spawnNewProcess
[
self value.
Processor terminateActive ] in BlockClosure>>newProcess


[Pharo-users] Accessors vs instance variables

2015-09-30 Thread Lyn Headley
Hello,

As I understand it, in Smalltalk, the instance variables of a class C are
"protected" - able to be referenced by methods of C or its subclasses, but
not by other objects. This is a useful feature as it clearly points out
which pieces of data are not available to other objects, and thereby
simplifies code.

However, I am often unsure of whether to use this feature or not, as it
conflicts in my mind with the practice of using accessor methods. I like
accessor methods because they make it easy to change behavior later -- If I
have a dozen calls to an accessor method, then I only need to change it in
one place. If these were instance variable references, I would have to do
more work. The disadvantage of accessor methods is that they obscure the
protected status of data -- it becomes unclear how protected an instance
variable is meant to be. (Accessors also make it harder for me to find
users of the data when browsing, when there are senders from totally
unrelated classes, although I suspect I have just not figured out how to
browse scoped in the right way for this).

It occurs to me that a tool could be (easily?) developed that would solve
this problem. It would take existing variable references and turn them into
calls to accessor methods. That way, I could have protection when I want
it, and easy ability to change code as well. Does something like this
exist, or is it feasible to build?

How do others think about this issue?

-Lyn