There are many other useful classes found in the system. Only a few of them are mentioned below.
Time
represent a particular time of day.
aTime := Time now
aTime := Time hours:hours minutes:minutes seconds:seconds
aTime hour
aTime minutes
aTime seconds
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.
aDate := Date today
aDate := Date day:day month:month year:year
aDate year
aDate month
aDate day
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
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.
aPoint := Point x:xCoordinate y:yCoordinate
aPoint := xCoordinate @ yCoordinate
xCoordinate := aPoint x
yCoordinate := aPoint y
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).
aRectangle := Rectangle origin:originPoint corner:cornerPoint
aRectangle := Rectangle origin:originPoint extent:extentPoint
aRectangle := Rectangle x:originX y:originY width:width height:height
originPoint := aRectangle origin
cornerPoint := aRectangle corner
extentPoint := aRectangle extent
width := aRectangle width
height := aRectangle height
newRectangle := aRectangle intersect:antherRectangle
newRectangle := aRectangle scaledBy:scaleFactor
newRectangle := aRectangle translatedBy:translation
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.
Using blocks, you can create your own control, enumeration and looping constructs.
Typical uses are:
aBoolean ifTrue:[ ... trueBlock ... ] ifFalse:[ ... falseBlock ... ]
[ ... conditionBlock ... ] whileTrue:[ ... loopedBlock ... ]
aCollection do:[:element | ... block executed for each element ... ]
aButton action:[ ... block executed when button is pressed ... ]
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
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
provides access to low level memory management functions.
There are methods to control the behavior of the garbage collector, interrupt handling etc.
more to be documented
Copyright © Claus Gittinger Development & Consulting, all rights reserved
(cg@ssw.de)