Based on:
Smalltalk-80: The Language and Its
Implementation, Author: Adele Goldberg and David Robson
Squeak Source Code, and the
readers of the Squeak mailing list.
Squeak site: http://www.squeak.org
See also the Squeak Language Reference page
Instance Creation (Class Side)
Notes:
|
Comparing Objects
Notes:
|
Testing Objects
Notes:
|
Copying Objects
|
Sending Messages to Objects
Note:
|
Indexing Objects
|
Displaying and Storing Objects
|
Interrogating Objects
|
Miscellaneous Messages on Objects
Notes:
|
Class MagnitudeThis abstract class embraces, among other classes, Numbers, Characters, Date and Time. It addresses classes whose instances can be linearly ordered.
|
Class CharacterSqueak has its own set of 256 characters, which may differ from that of the host platform. Instances of class Character store an 8-bit character code.
|
Methods for instance creation (Class side)Most of the time, characters literals
Note:
|
Methods for accessing Characters
Note:
|
Methods for testing Characters
|
Methods for converting Characters
|
Numeric Classes and MethodsClass NumberThis abstract class embraces Integers, Floats and Fractions. Number is a subclass of Magnitude. |
||||||||||||||||||||||||||||||||||||
Methods for arithmetic on all Numeric Classes
|
Methods implementing mathematical functions for Numbers
|
Methods for testing Numbers
|
Methods for truncating and rounding Numbers
|
Methods for trigonometry on Numbers
|
Class IntegerMethods for arithmetic on Integers
|
Methods for bit manipulation on IntegersA range of bit manipulation operations are available on Integers. They are rarely needed, however, so they are not described here. Of course, they can be viewed using the browser.
|
Collection Classes and MethodsThe Collection Hierarchy
|
Class CollectionMethods for creating Collections (Class Side)
Methods for testing Collections
|
Methods for adding and removing Collection elements
|
Methods for enumerating Collections
|
BagMethods for accessing Bags
|
Dictionary and IdentityDictionaryMethods for Accessing DictionariesDictionaries are homogenous Sets of key and value pairs.
These pairs are called Associations: key and value can be
any object. Instances of Association are created by sending
the binary message "
|
Sequenceable CollectionMethods for accessing SequenceableCollections
|
Methods for copying SequenceableCollections
|
Methods for enumerating SequenceableCollections
|
OrderedCollectionsMethods for accessing OrderedCollections
|
StringsString is an extensive class, built over the ages in something of an ad hoc manner. We describe here only a small fraction of the methods provided (there are about 300!) |
|||||||||||||||||||||||||||||||||
Methods for accessing Strings
Notes
|
Methods for comparing Strings
|
Methods for converting Strings
|
Streaming Classes and MethodsThe Stream Hierarchy
|
Class StreamStream is an abstract class for an accessor to a sequence of objects, called the contents. The stream is said to be "advanced" when the stream is configured to access a later element of the contents. |
Methods for accessing Streams
|
Methods for testing Streams
|
Methods for enumerating Streams
|
Class PositionableStreamPositionableStream is an abstract class for accessors to sequences of objects that can be externally named by indices so that the point of access can be repositioned. Concrete classes ReadStream, WriteStream and ReadWriteStream are typically used to instantiate a PositionableStream on Collections, depending upon the access mode. StandardFileStream and CRLFFileStream are typically used for instantiating PositionableStreams for Files. |
Methods for accessing PositionableStreams
|
Methods for testing PositionableStreams
|
Methods for positioning PositionableStreams
|
Class WriteStreamMethods for writing characters on WriteStreams
|
ANSI-Compatible ExceptionsEvaluating Blocks with ExceptionsMethods for handling Exceptions raised in a BlockContext
|
Examples["target code, which may abort"] ensure: ["code that will always be executed after the target code, whatever whatever may happen"] ["target code, which may abort"] ifCurtailed: ["code that will be executed whenever the target code terminates without a normal return"] ["target code, which may abort"] on: Exception do: [:exception | "code that will be executed whenever the identified Exception is signaled."] |
ExceptionsException is an abstract class; instances should neither be created nor trapped. There are two common subclasses of Exception, Error and Notification, from which subclasses normally inherit. Errors are not resumable; a Notification is an indication that something interesting has occurred; if it is not handled, it will pass by without effect. Exceptions play two distinct roles: that of the exception, and that of the exception handler. |
Methods for describing Exceptions
|
Methods for signalling Exceptions
|
Methods for dealing with a signaled Exception
|
Class ExceptionSetAn ExceptionSet is used to specify a set of exceptions for an exception handler. Creating ExceptionSet
|
Example["target code, which may abort"] on: Exception, Error, ZeroDivide do: [:exception | "code that will be executed whenever one of the identified Exceptions is signaled."] |
The Squeak Class HierarchyIn Smalltalk, "everything is an object." That is, everything is an instance of class Object or an instance of some subclass of class Object. Everything. Numbers, Classes, Metaclasses, everything. I refer to this as the "Object rule." Actually, Squeak bends this rule a little bit; the Object rule does not apply for certain system objects, which derive from class ProtoObject. Nevertheless, except for these few system objects, the vast majority of Squeak objects, which I call, "proper objects," satisfy the Object Rule. Proper Objects and their classes and metaclasses, satisfy the following properties. |
The Laws of Proper (Smalltalk) Classes
|
Class ProtoObjectSqueak additionally supports an improper class ProtoObject, from which object hierarchies other than proper instances and proper classes can inherit. ProtoObject is the superclass of class Object and has no instances. Presently, there are two subclasses of ProtoObject besides Object: ObjectOut and ImageSegmentRootStub, both of which are used to do magic involving objects that have been moved out of memory onto an external medium. You might need to subclass ProtoObject if you are doing something like implementing a remote message send system where you have proxies for remote objects (those on another computer). However, as with proper classes, ProtoObject, is an instance of a metaclass, ProtoObject class, which in turn is an instance of class MetaClass. |
Categories of Squeak ClassesThis quick reference only scratches the surface of the functionality available through Squeak. To assist the beginner in surveying the system, the following outline of the major Squeak packages is provided.
|