Distinctions, Forms, and Objects

We have said numerous times that objects model distinctions. However, we have not examined this issue rigurously until now. It is time we take care of the loose ends so we can rely on a solid foundation for our traversals.

For example, distinctions are drawn in a form. We have assumed we always have a form where to create our objects, but what is that form exactly? And why can we assume it is always there so lightly?

It turns out that the form is the object memory, and since Smalltalk provides automatic memory management, we do not have to worry about it. Stop for a moment and consider the implications. Drawing distinctions is what we do when we write Smalltalk programs. Drawing distinctions is what programs do for us. Automatic memory management means that the most important and elementary operations that occur in the process of reaching our objectives are tax free. In other words, Smalltalk not only keeps out of our way when we try to get things accomplished – it actually spends quite a bit of effort to let us achieve our goals without distractions.

~

Nobody should have to put up with mandatory hindrances when using our most critical abilities: to perceive differences in value, to draw distinctions, to name those distinctions, and to allow messages to cross distinctions. Any level of inefficiency, obscurity, or unnecessary complication regarding these matters comes with extremely expensive consequences. If we allow any of these issues to creep up on us, we will also give up to their stealthy yet powerful influences. There is no limit to how much they can pervasively limit us, while at the same time letting us believe we are accomplishing something valuable. This delusion is absolutely inexcusable and unacceptable, and must be fought back at all costs.

~

Another issue that merits careful consideration is that when distinctions are drawn, the form on which they are inscribed is severed into two perfectly disjoint areas. These two are forms as well. That means that drawing a distinction creates a new form inside of it, and therefore objects contain their forms. What about their contents? In the same way we draw distinctions on a form, in Smalltalk we reference other objects by means of instance names and indexed slots. Since the internal structure of objects is defined by their class, this means that the shape of object forms is both predetermined and fixed.

Even things like ordered collections are implemented in terms of fixed size objects — either arrays or themselves.

So what are objects, distinctions or forms? Well. . . actually, objects exhibit dual behavior. Seen from the outside, they behave like a distinction because they separate their insides from the outside. We typically mean this when we say that objects provide strong encapsulation for their “contents” — it is impossible to access the instance names of an object4. However, when seen from within, objects are forms. When the point of view resides inside of them, their contents are immediately accessible without the need to send a message. In this way, objects are both distinctions and forms at the same time. At any time, we can change the point of view by sending a message to an object and crossing the distinction boundary.

Something we have not discussed yet is the fact that the value of names can change in Smalltalk. As far as tracking down references to an object goes, however, we can assume that the values of names do not change. Therefore, we will leave the transmission of values across networks of distinctions for later.

~