Top: GNU Smalltalk User's Guide Contents: Table of Contents Index: About: About this document

Footnotes

(1)

The directory would be called `_st/' under MS-DOS. Under OSes that don't use home directories, it would be looked for in the current directory.

(2)

The words in the shell command exec are all quoted, so GNU Smalltalk parses them as five separate comments.

(3)

The directory is called `_st/kernel' under MS-DOS. Under OSes that don't use home directories, it is looked for in the current directory.

(4)

The file is looked up as `_st/pre.st' under MS-DOS and again, under OSes that don't use home directories it is looked for as `pre.st' in the current directory.

(5)

The same considerations made above hold here too. The file is called `_st/init.st' under MS-DOS, and is looked for in the current directory under OSes that don't use home directories.

(6)

It also bears mentioning that there are two assignment operators: _ and :=. Both are usable interchangeably, provided that they are surrounded by spaces. The GNU Smalltalk kernel code uses the := form exclusively, but _ is supported a) for compatibility with previous versions of GNU Smalltalk b) because this is the correct mapping between the assignment operator mentioned in the Blue Book and the current ASCII definition. In the ancient days (like the middle 70's), the ASCII underscore character was also printed as a back-arrow, and many terminals would display it that way, thus its current usage. Anyway, using _ may lead to portability problems.

(7)

Of course, they may be more constrained by usage of GPL class libraries.

(8)

Whereas it must be given as `\\\\' in a literal Emacs Lisp string, for example.

(9)

The denomination grey comes from the lexicon of tri-color marking, which is an abstraction of every possible garbage collection algorithm: in tri-color marking, grey objects are those that are known to be reachable or that we are not interested in reclaiming, yet have not been scanned to mark the objects that they refer to as reachable.

(10)

Black objects are those that are known to be reachable or that we are not interested in reclaiming, and are known to have references only to other black or grey objects (in case you're curious, the tri-color marking algorithm goes on like this: object not yet known to be reachable are white, and when all objects are either black or white, the white ones are garbage).

(11)

Remember that free pages are shared among the three heaps, that is, OldSpace, FixedSpace and the malloc heap. When a large object is freed, the memory that it used can be reused by malloc or by OldSpace allocation

(12)

This is short for Ordinary Object Pointer.

(13)

All the classes mentioned in this section reside in the I18N namespace.

(14)

Character equality with = will be as fast as with ==.

(15)

The ? method does not apply to the LcMessagesDomain class itself, but only to its instances. This is because LcMessagesDomain is not a subclass of Locale.

(16)

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.

(17)

The most notable are AIX and Windows.

(18)

Actually they have a common superclass named CCompound.

(19)

The GLUT bindings use a different scheme for setting up callbacks.

(20)

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'. You should use the nilOOP field of the interpreter proxy, or getObjectClass.

(21)

You can also have the system print out a lot of statistics which provide information on the performance of the underlying Smalltalk engine. You can enable them by starting Smalltalk as:
 
   $ gst -V

(22)

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.

(23)

Actually, the message printNl was inherited from Object. It sent a print message, also inherited by Object, which then sent printOn: to the object, specifying that it print to the Transcript object. The String class then prints its characters to the standard output.

(24)

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 IdentityDictionary, which becomes `Ide<TAB>D<TAB>'. Everything starting with a capital letter or ending with a colon can be completed.

(25)

Alert readers will remember that the math examples of the previous chapter deviated from this.

(26)

And unlike C, Smalltalk draws a distinction between 0 and nil. nil 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.

(27)

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.

(28)

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, but self will find the first definition of the message which it can.

(29)

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.

(30)

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.

(31)

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 overkill) to store a dictionary as the value--and then store as many pieces of information as you'd like under each slot!

(32)

The 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 keysDo: message, for example, works only with dictionaries.

(33)

There is also a valueWithArguments: message which accepts an array holding as many arguments as you would like.

(34)

When using the Blox GUI, it actually pops up a so-called Inspector window.

(35)

This listing is courtesy of the printHierarchy method supplied by GNU Smalltalk author Steve Byrne. It's in the `kernel/Browser.st' file.

(36)

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 semantic that || evaluates left-to-right only as far as needed. We could have written the expressions as ((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.

(37)

A GNU Smalltalk extension allows you to type characters by ASCII code too, as in $<43>.

(38)

Try executing it under Blox, where the Transcript is linked to the omonymous window!

(39)

For GNU Smalltalk, the size of a C long, which is usually 32 bits.

(40)

C requires one or more; zero is allowed in Smalltalk

(41)

This is not always true for other Smalltalk implementations, who don't allow instance variables in variableByteSubclasses and variableWordSubclasses.

(42)

Actually, in GNU Smalltalk do: is not the only message assuming that.

(43)

Some of these classes actually redefine do: for performance reasons, but they would work even if the parent class' implementation of do: was kept.

(44)

Which turns out to be another subclass of ClassDescription.

(45)

And like the one that GNU Smalltalk includes as an experimental feature.

(46)

You won't ever send this message in Smalltalk programs. The compiler uses it when compiling blocks.


Top: GNU Smalltalk User's Guide Contents: Table of Contents Index: About: About this document


This document was generated on August, 19 2010 using texi2html