openlang

What does this notation mean when using Pharo Smalltalk?

How should I interpret the notation { ...: ...}? An example:

Class {
  #name : #DemoCases,
  #superclass : #Object,
  #category : #'Demo-Core-Cases-OLD'
}

{ #category : #accessing }
DemoCases >> recursiveBlock [
  | block |
  block := [ block ].
  ^ block
]

Does this represent a dictionary? The Pharo Cheat Sheet didn't mention this notation anywhere. Can I use it inside method bodies or Playground?

The conversation continues 2

Follow the reasoning
  1. Permalink

    That isn't syntax belonging to Pharo itself. You're looking at the "tonel" code storage format. It combines code with pieces of STON (Smalltalk Object Notation, roughly Pharo's equivalent of JSON).

    And it cannot go straight into Playground, you must import it with suitable tooling (Iceberg or Monticello, for example).

  2. Permalink

    For some further background reading on Tonel's file format, consult its specification (https://github.com/GemTalk/TonelSpec). The format was created to improve git integration. Earlier Smalltalk environments used other systems for version control, among them Monticello dvcs, which delayed the move toward git.

Other sides of the same question

  1. Using MATLAB through Google Colab

    Can MATLAB commnads be used from Google Colab (cloud-hosted Jupyter)? For instance, I'd like to invoke Risk Management Toolbo…

    Replies 2Latest activity matlab
  2. Can gdb set a breakpoint for an assembly instruction using its address?

    My attempt: apparently this command does not exist, though. Can gdb do something like this?

    Replies 2Latest activity assembly
  3. Can Playwright assertions allow either of two possible text values?

    I'd like to verify that the text contains either one or two: Can this be made to work in Playwright? Could the same thing als…

    Replies 2Latest activity typescript