String and Files
Cincom's first tutorial on VisualWorks illustrates how VisualWorks can be used to manipulate server log files. It illustrates how things like strings and files can be easily subsumed into the object structure within VisualWorks. Consider the Smalltalk expression:
'ws000101.log' asFilename editOne can evaluate this expression as-is in a VisualWorks workspace using one command in the operate menu. This creates:
- An object of class ByteString containing the string (as bytes) and the methods for manipulating it;
- An object of class NTFSFilename (in Windows XP); and
- An editor object.
The latter is a simple notebook-like editor containing the contents of the file. That is, the evaluation created a filename object as a gateway to the file ws000101.log
and opened an editor onto it. The editor itself is an object, as are all its components (down to and including the characters in its menus). The source code is available for all these objects, and VisualWorks has a plethora of inspectors, browsers, and other tools for anyone to evaluate and inspect the code in static or dynamic mode.
Read more about this topic: VisualWorks
Famous quotes containing the words string and/or files:
“The most perfect expression of human behavior is a string quartet.”
—Jeffrey Tate (b. 1943)
“The good husband finds method as efficient in the packing of fire-wood in a shed, or in the harvesting of fruits in the cellar, as in Peninsular campaigns or the files of the Department of State.”
—Ralph Waldo Emerson (18031882)