Tutorial by Examples

Coments "Comments are enclosed in double quotes. BEWARE: This is NOT a string!" "They can span multiple lines." Strings 'Strings are enclosed in sigle quotes.' 'Single quotes are escaped with a single quote, like this: ''.' '''' "<--This string contains one sin...
In Smalltalk almost everything you do is sending messages to objects (referred as calling methods in other languages). There are three types of messages: Unary messages: #(1 2 3) size "This sends the #size message to the #(1 2 3) array. #size is a unary message, because it takes no argumen...
Classes and methods are usually defined in the Smalltalk IDE. Classes A class definition looks something like this in the browser: XMLTokenizer subclass: #XMLParser instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'XML-Parser' This is actually...
For this example, an Ordered Collection will be used to show the different messages that can be sent to an OrderedCollection object to loop over the elements.The code below will instantiate an empty OrderedCollection using the message new and then populate it with 4 numbers using the message add: a...

Page 1 of 1