prev back next

Other classes

There are many other useful classes found in the system. Only a few of them are mentioned below.

Use the systemBrowser to have a more detailed look into the implementation.

Time

Instances of Time represent a particular time of day.
The typical uses are:

Times class protocol also provides useful methods to measure the execution time of a block and to get the internal (millisecond-)timers value.

Notice that Time only represents times within a day - instances do not differenciate between times of different dates. Use AbsoluteTime to represent a time at a particular date.

Date

Date represents a particular calendar day.
Typical uses are:

Dates class protocol also provides many methods to convert months or days to/from string representation, to query for leapyears etc.

Character

Instances of Character represent printable characters. The character range is not limited to 8bit; 16bit characters are possible.

Characters are most often used as elements of String and TwoByteString; on their own, they are seldom encountered.

Point

Instances of Point represent a coordinate in 2D space. They are most often used in the graphical user interface to represent window positions, window extents, position of graphical objects etc.
Typical uses are:

Rectangle

Like with Point, instances of Rectangle are used in the graphical user interface. They represent a rectangular area defined by an originPoint and a cornerPoint. (the actual internal implementation may be different).
Typical uses are:

Boolean

Boolean is the abstract superclass of the two classes True and False, of which each has only one instance: true and false respectively.

Conceptionally, conditional evaluation of expressions is implemented by booleans; however, most control structures are inline coded by the compilers for more performance.

Block

Blocks represent pieces of executable code, which can be evaluated upon request. Conceptionally, all control structures in smalltalk are implemented using blocks; however, most are inline coded by the compilers for more performance.
Blocks keep the methods environment in which they where created (they are really closures). Therefore, it is possible to access method locals from within a block even after the creating method has returned (For the curious: as in ST-80).

Using blocks, you can create your own control, enumeration and looping constructs.
Typical uses are:

To make good use of the smalltalk language, blocks should be understood in depth.

OperatingSystem

Class OperatingSystem offers low level access to the underlying OS services. The actual set of implemented depends on the particular OS used. For portability, you should try to avoid use methods - most of this functionality is also available via standard classes, such as Time, FileStream, Filename etc.

more to be documented

Smalltalk

Class Smalltalk keeps track of all global variables on the system. Also, it offers many functions for system management, initialization, startup and shutdown.

more to be documented

ObjectMemory

Class ObjectMemory provides access to low level memory management functions. There are methods to control the behavior of the garbage collector, interrupt handling etc.
Also, query methods on memory usage, GC reclamation rates are found there.

more to be documented


Copyright © Claus Gittinger Development & Consulting, all rights reserved

(cg@ssw.de)