Appendix A
Frequently Asked Questions

A.1 Getting started

FAQ 1 Where do I get the latest Pharo?

FAQ 2 Which Pharo image should I use with this book?
Answer  You should be able to use any Pharo image, but we recommend you to use the prepared image on the Pharo by Example web site: You should also be able to use most other images, but you may find that the hands-on exercises behave differently in surprising ways.

A.2 Collections

FAQ 3 How do I sort an OrderedCollection?

Answer  Send it the message asSortedCollection.
#(7 2 6 1) asSortedCollection -→ a SortedCollection(1 2 6 7)  

FAQ 4 How do I convert a collection of characters to a String?

String streamContents: [:str | str nextPutAll: hello asSet] -→ hleo  

A.3 Browsing the system

FAQ 5 The browser does not look like the one described in the book. What gives?

Answer  You are probably using an image in which a different version of the OmniBrowser is installed as the default browser. In this book we assume that the OmniBrowser Package Browser is installed as the default. You can change the default by clicking on the menu bar of the browser. Just click on the gray lozenge in the top right corner of the window, select “Choose new default Browser”, and then pick the O2PackageBrowserAdaptor. The next browser you open will be the Package Browser.
(a) Choose a new browser
(b) Select the OB Package Browser

Figure A.1: Changing the default browser

FAQ 6 How do I search for a class?
Answer  CMD–b (browse) on the class name, or CMD–f in the category pane of the browser.
FAQ 7 How do I find/browse all sends to super?
Answer  The second solution is much faster:
SystemNavigation default browseMethodsWithSourceString: super. 
SystemNavigation default browseAllSelect: [:method | method sendsToSuper ].  

FAQ 8 How do I browse all super sends within a hierarchy?

browseSuperSends := [:aClass | SystemNavigation default 
    browseMessageList: (aClass withAllSubclasses gather: [ :each | 
        (each methodDict associations 
            select: [ :assoc | assoc value sendsToSuper ]) 
                collect: [ :assoc | MethodReference class: each selector: assoc key ] ]) 
    name: Supersends of  , aClass name ,  and its subclasses]. 
browseSuperSends value: OrderedCollection.  

FAQ 9 How do I find out which new methods are introduced by a class? (I.e., not including overridden methods.)

Answer  Here we ask which methods are introduced by True:
newMethods := [:aClass| aClass methodDict keys select: 
    [:aMethod | (aClass superclass canUnderstand: aMethod) not ]]. 
newMethods value: True -→ an IdentitySet(#asBit #xor:)  

FAQ 10 How do I tell which methods of a class are abstract?

abstractMethods := 
    [:aClass | aClass methodDict keys select: 
        [:aMethod | (aClass>>aMethod) isAbstract ]]. 
abstractMethods value: Collection -→ an IdentitySet(#remove:ifAbsent: #add: #do:)  

FAQ 11 How do I generate a view of the AST of an expression?

Answer  Load AST from Then evaluate:
(RBParser parseExpression: 3+4) explore  
(Alternatively explore it.)

FAQ 12 How do I find all the Traits in the system?

Smalltalk allTraits  

FAQ 13 How do I find which classes use traits?

Smalltalk allClasses select: [:each | each hasTraitComposition and: [each traitComposition notEmpty ]]  

A.4 Using Monticello and SqueakSource

FAQ 14 How do I load a SqueakSource project?

Find the project you want in
Copy the registration code snippet
Select open Monticello browser
Select +Repository HTTP
Paste and accept the Registration code snippet; enter your password
Select the new repository and Open it
Select and load the latest version

FAQ 15 How do I create a SqueakSource project?

Go to
Register yourself as a new member
Register a project (name = category)
Copy the Registration code snippet
open Monticello browser
+Package to add the category
Select the package
+Repository HTTP
Paste and accept the Registration code snippet; enter your password
Save to save the first version

FAQ 16 How do I extend Number with Numberchf but have Monticello recognize it as being part of my Money project?

Answer  Put it in a method-category named *Money. Monticello gathers all methods that are in other categories named like *package and includes them in your package.

A.5 Tools

FAQ 17 How do I programmatically open the SUnit TestRunner?

Answer  Evaluate TestRunner open.
FAQ 18 Where can I find the Refactoring Browser?
Answer  Load AST then Refactoring Engine from
FAQ 19 How do I register the browser that I want to be the default?
Answer  Click the menu icon in the top right of the Browser window.

A.6 Regular expressions and parsing

FAQ 20 Where is the documentation for the RegEx package?

Answer  Look at the DOCUMENTATION protocol of RxParser class in the VB-Regex category.
FAQ 21 Are there tools for writing parsers?
Answer  Use SmaCC — the Smalltalk Compiler Compiler. You should install at least SmaCC-lr.13. Load it from There is a nice tutorial online:
FAQ 22 Which packages should I load from SqueakSource SmaccDevelopment to write parsers?
Answer  Load the latest version of SmaCCDev — the runtime is already there. (SmaCC-Development is for Squeak 3.8)