Breaking open toys in Smalltalk

For a lot of people, having to work inside the “walled garden” of a VM, with its own GUI and everything, is one of the biggest barriers to learning Smalltalk. Today I made a little video about one way that working in this environment can actually be empowering.

By the way, full disclosure: I cheated a little bit, because someone told me where I should look for the message whitelist. But! Nobody told me how to trace from the GUI all the way back back to the class and method the whitelist is found in. I was able to work that out for myself, and pretty quickly too. This is one of the benefits of working in a highly explorable and reflective development environment.

As before, the Smalltalk I’m using is Pharo 4.

11 comments

  1. Oh I remember the good old days, working with Digitalk’s Smalltalk Enterprise and modifying its Package Explorer, analogous to Pharo’s System Browser. It was so nice to be able to mold the development tools to our needs.

    Question: are you finding people using the term ‘Category’ over ‘Package’? It’s been my experience Smalltalk folks tend to use the term Package more often.

    Again: Thanks for the screencast.

    1. In Pharo, “categories” and “packages” are two different things. Categories are just that. Packages, as I understand them, are a bit more – almost like a gem in Ruby.

      1. Interesting! I can’t wait to learn more as I start to explore Pharo on my own. And, admittedly it’s been since 1998 when I last worked with Smalltalk in nearly any capacity (it does no good to have plans without acting on them, right?).

        At that time Packages were, I guess, similar to the functionality of today’s Ruby gems: a mechanism to group and share code.

        However, I also remember being able to define methods on objects that only existed within Packages. An interesting organizational approach, to be sure.

        Thanks for sharing. Enjoy the exploration! I hope to be able to explore along with you.

      2. Inherited from Squeak and Smalltalk-80, “categories” where a way to tag classes with strings so they could be grouped for presentation in the code browser. i.e. “categories” were not real package objects. “Real” packages were introduced in Pharo 2.0 by the RPackage class, Pharo 3.0 transitioned to RPackage, and Pharo 4.0 removed the string-tag implementation.

        Exploratory tip: Look at the code behind the menu items.
        1. Scroll to the end of the package list in the Browser. For its context-menu-item “Add package”, bring up the halos and click the spanner and “inspect morph”.
        2. Select the last instance variable /target/ then on the right select text “addPackage” > Code search > implementors of it. Put a “self halt” in the “addPackage” method after the variable definition.
        3. Now back in the Browser click the “Add package” menu item. In the debugger, step #addPackageBasedOn: then #on:do: and “super addPackageBasedOn:”
        4. Also check out class RPackageOrganizerTest.

  2. I have been loving all your tweets and posts about getting into Smalltalk – I was there about 5 years ago when I found Maglev – I was also lucky enough to have a “Smalltalk Sherpa” (TM Dave Brady).

    Here are 2 Pharo tips that may prove useful:

    1) The -. (or -.) key combo will trigger a User Interupt. This is especially useful when you first fork bomb or jump into an infinite loop (and everything in your image becomes unresponsive).

    2) If you have to force quit Pharo (and had unsaved changes) – there is World Menu > Tools > Recover Lost Changes tool that can help you do just that

    Also – If you’re interested – I would love to remote pair sometime (we could even chat about MagLev 🙂

  3. Fun!

    Please tell me what is the magic key combination to get to the debug menu for views (hallo if I understood correctly)

        1. whoops, I used angled brackets to delineate key and mouse actions, and they got stripped out. On Mac is shift+middle-mouse-click or shift+option+left-mouse-click. On Windows maybe shift+alt+left-mouse-click.

Comments are closed.