Buy GNU books!
|[Top]||[Contents]||[Index]||[ ? ]|
The file is called `_stpre' under MS-DOS and `.gstpre' on the Atari ST. Under OSes that don't use home directories it is looked for in the current directory.
The same considerations made above hold here too. The file is called `_stinit' under MS-DOS and `.gstinit' on the Atari ST, and is looked for in the current directory under OSes that don't use home directories.
An inheritance tree in the current GNU Smalltalk implementation of namespaces; a class can fake multiple inheritance by specifying a namespace (environment, if you prefer) as one of its pool dictionaries.
Absent from the original paper.
When using an alternate image path, don't use the -K option and pass the full path to the `Load.st' script.
All the classes
mentioned in this section reside in the
the classes mentioned in this section reside in the
does not apply to the LcMessagesDomain class itself, but only to its
instances. This is because LcMessagesDomain is not a subclass of
Extreme Programming is a software engineering technique that focuses on team work (to the point that a programmer looks in real-time at what another one is typing), frequent testing of the program, and incremental design.
A Wiki is a kind of collaborative web site, which allows one to edit the contents of a page.
The most notable are AIX and Windows.
Specifying `-no-undefined' is not necessary, but it does perform that the portability conditions explained above (no reference to symbols in the virtual machine) are satisfied
Actually they have a common superclass
#newStruct:declaration: method for creating CStructs is
deprecated because it does not allow one to set the category.
IS_NIL and IS_CLASS have been removed because they are problematic in shared libraries (modules), where they caused undefined symbols to be present in the shared library. These are now private to `libgst.a'.
It also prints out a lot of statistics. Ignore these; they provide information on the performance of the underlying Smalltalk engine. You can inhibit them by starting Smalltalk as either:
$ gst -q
$ gst -r
Which table? This is determined by the type
of the object. An object has a type, known as the
class to which it belongs. Each class has a table
of methods. For the object we created, it is
known as a member of the
String class. So we go
to the table associated with the String class.
Actually, the message
printNl was inherited
from Object. It sent a
the object, specifying that it print to the
object. The String class then prints its characters to the
GNU Smalltalk supports completion in the same way as Bash or GDB.
To enter the following line, you can for example type
`x := Arr<TAB> new: 20'. This can come in handy
when you have to type long names such as
which becomes `Ide<TAB>D<TAB>'. Everything
starting with a capital letter or ending with a colon can
Alert readers will remember that the math examples of the previous chapter deviated from this.
Actually, a SystemDictionary, which is just a Dictionary with some extra methods to run things when Smalltalk first starts and to do nice things with a Smalltalk environment
For more detail, See section 4.11.2 Two flavors of equality
In case you're having a hard time making out
the font, the " after
poolDictionaries: are a pair of single quotes--an
And unlike C, Smalltalk
draws a distinction between
is the nothing object, and you will receive an error if you
try to do, say, math on it. It really does matter that we
initialize our instance variable to the number 0 if we wish
to do math on it in the future.
And why didn't the designers default the return value to nil? Perhaps they didn't appreciate the value of void functions. After all, at the time Smalltalk was being designed, C didn't even have a void data type.
self is much like
super, except that
self will start looking for a method at the bottom
of the type hierarchy for the object, while
super starts looking one level up from the current
level. Thus, using
super forces inheritance,
self will find the first definition
of the message which it can.
Of course, in a real accounting system we would never discard such information--we'd probably throw it into a Dictionary object, indexed by the year that we're finishing. The ambitious might want to try their hand at implementing such an enhancement.
It is interesting to note that because of the way conditionals are done, conditional constructs are not part of the Smalltalk language, instead they are merely a defined behavior for the Boolean class of objects.
You might start to wonder what one would do if you wished to associate two pieces of information under one key. Say, the value and who the check was written to. There are several ways; the best would probably be to create a new, custom object which contained this information, and then store this object under the check number key in the dictionary. It would also be valid (though probably over-kill) to store a dictionary as the value--and then store as many pieces of information as you'd like under each slot!
do: message is understood by most types
of Smalltalk collections. It works for the
Dictionary class, as well as sets, arrays, strings,
intervals, linked lists, bags, and streams. The
associationsDo: message works only with dictionaries.
The difference is that
do: passes only the
value portion, while
associationsDo: passes the
entire key/value pair in an Association object.
There is also a
which accepts an array holding as many arguments
as you would like.
When using the Blox GUI, it actually pops up a so-called Inspector window.
This listing is courtesy of the printHierarchy method supplied by GNU Smalltalk author Steve Byrne. It's in the `kernel/Browser.st' file.
Smalltalk also offers an
or: message, which
is different in a subtle way from
|. or: takes
a code block, and only invokes the code block if
it's necessary to determine the value of the
expression. This is analogous to the guaranteed C
|| evaluates left-to-right only as
far as needed. We could have written the expressions
((index < 1) or: [index > (self basicSize)]).
Since we expect both sides of or: to be
false most of the time, there isn't much reason to
delay evaluation of either side in this case.
Try executing it under Blox, where the Transcript is linked to the omonymous window!
For GNU Smalltalk, the size of a C
is usually 32 bits.
C requires one or more; zero is allowed in Smalltalk
This is not always true for other Smalltalk implementations, who don't allow instance variables in variableByteSubclasses and variableWordSubclasses.
Actually, in GNU Smalltalk
do: is not the only
message assuming that.
Some of these classes
do: for performance reasons, but they
would work even if the parent class' implementation of
out to be another subclass of
And like the one that GNU Smalltalk includes as an experimental feature.
won't ever send this message in Smalltalk programs. The compiler uses it when
|webmaster donations bookstore||delorie software privacy|
|Copyright © 2003 by The Free Software Foundation||Updated Jun 2003|