Skip to main content
Engineering LibreTexts

13.3: Browsing the System

  • Page ID
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    FAQ \(\PageIndex{1}\)

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


    You are probably using an image in which the OmniBrowser is installed as the default System browser. You can change the default by clicking on the little menu icon in the top-left corner of the browser window, between the “X” and the browser label, and selecting “Choose new default browser” from the menu that appears. Select #Browser to get the plain old browser. (This preference changes the effect of the World ⊳ open . . . ⊳ system browser menu, but not what happens when you drag the Browser icon from the Tools flap.)

    FAQ \(\PageIndex{2}\)

    How do I search for a class?


    CMD–b (browse) on the class name, or CMD–f in the category pane of the class browser.

    FAQ \(\PageIndex{3}\)

    How do I find/browse all sends to super?


    The second solution is much faster:

    SystemNavigation default browseMethodsWithSourceString: 'super'.
    SystemNavigation default browseAllSelect: [:method | method sendsToSuper ].

    FAQ \(\PageIndex{4}\)

    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 \(\PageIndex{5}\)

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


    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)

    FAQ \(\PageIndex{6}\)

    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:

    FAQ \(\PageIndex{7}\)

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


    Load AST from Then evaluate:

    (RBParser parseExpression: '3+4') explore

    (Alternatively explore it.)

    FAQ \(\PageIndex{8}\)

    How do I find all the Traits in the system?


    Smalltalk allTraits

    FAQ \(\PageIndex{9}\)

    How do I find which classes use traits?


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

    This page titled 13.3: Browsing the System is shared under a CC BY-SA 3.0 license and was authored, remixed, and/or curated by Andrew P. Black, Stéphane Ducasse, Oscar Nierstrasz, Damien Pollet via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.