Skip to content
lauritzthamsen edited this page Jan 19, 2013 · 2 revisions

Coding Conventions: Squeak/Smalltalk

Class>>somethingAnswersValue
    "a comment"

    | y |
    true & false not & nil isNil ifFalse: [self halt]. 
    #($a #a ‘a’ 1 1.0) do: [:each | 
        Transcript 
            show: (each class name); 
            show: (each printString); 
            show: ‘ ‘].
    self isActive whileTrue: 
        [self 
            compute;
            indicateProgress: [Transcript show: '.']].
    (1 == 1) ifTrue: 
       [Transcript
            show: 'Blaaaa';
            show: 'Muhhhh'].
    ^ x < y
Class>>doSomething

    self clearStream. 
    self
        onStream: self stream
        of: self content.
    self printStream: self stream.

Inspired by:

Clone this wiki locally