4 Matching Annotations
  1. Dec 2023
    1. (13) When considering its parents, the combined method count is more than 300.

      Number selectors size vs Number allSelectors size

    2. Tip. In the workspace Ctrl-b (Browse) on the class name will open a Browser on the named class:

      Programmatically you can send #browseClassHierarchy to any object

    3. How many methods are there in the arithmetic method category of the CharacterSequence class?

      There are no messages categorized as arithmetic in String but in CharacterSequence, which String subclassifies. Squeak Strings on the other hand, implement arithmetic messages, exactly those mentioned in the solution to the exercise; Note however that String allMethodsInCategory: #arithmetic in both Cuis and Squeak include a seventh method #raisedTo: because #allMethodsInCategory also looks up for inherited methods from superclasses. Yes! you can raise the empty string to the power of n for n ∈ Number and the result is another empty string! WAT :) The fact that we can evaluate '' raisedTo: n without error seems like an unforeseen consequence of #adaptToCollection:andSend: relying on #collect and how the latter works on empty collections.

      See this thread in the Squeak-dev mailing list

  2. Sep 2021