<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://trans.onionmixer.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Smalltalk80LanguageImplementation%3AChapter_14</id>
	<title>Smalltalk80LanguageImplementation:Chapter 14 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://trans.onionmixer.net/wiki/index.php?action=history&amp;feed=atom&amp;title=Smalltalk80LanguageImplementation%3AChapter_14"/>
	<link rel="alternate" type="text/html" href="https://trans.onionmixer.net/wiki/index.php?title=Smalltalk80LanguageImplementation:Chapter_14&amp;action=history"/>
	<updated>2026-05-01T12:00:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.3</generator>
	<entry>
		<id>https://trans.onionmixer.net/wiki/index.php?title=Smalltalk80LanguageImplementation:Chapter_14&amp;diff=4782&amp;oldid=prev</id>
		<title>Onionmixer: 오타수정</title>
		<link rel="alternate" type="text/html" href="https://trans.onionmixer.net/wiki/index.php?title=Smalltalk80LanguageImplementation:Chapter_14&amp;diff=4782&amp;oldid=prev"/>
		<updated>2015-07-12T09:38:35Z</updated>

		<summary type="html">&lt;p&gt;오타수정&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:38, 12 July 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l120&quot;&gt;Line 120:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 120:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;where className mentions the class of the receiver and messageSelector is the selector of the erroneously-sent message.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;where className mentions the class of the receiver and messageSelector is the selector of the erroneously-sent message.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note, if nil were an instance of Object, then a message sent to it in error would state&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Note, if nil were an instance of Object, then a message sent to it in error would state&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l402&quot;&gt;Line 402:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 404:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Message Handling===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===Message Handling===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ll &lt;/del&gt;processing in the Smalltalk-80 system is carried out by sending messages to objects. For reasons of efficiency, instances of class Message are only created when an error occurs and the message state must be stored in an accessible structure. Most messages in the system, therefore, do not take the form of directly creating an instance of Message and transmitting it to an object.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;All &lt;/ins&gt;processing in the Smalltalk-80 system is carried out by sending messages to objects. For reasons of efficiency, instances of class Message are only created when an error occurs and the message state must be stored in an accessible structure. Most messages in the system, therefore, do not take the form of directly creating an instance of Message and transmitting it to an object.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Onionmixer</name></author>
	</entry>
	<entry>
		<id>https://trans.onionmixer.net/wiki/index.php?title=Smalltalk80LanguageImplementation:Chapter_14&amp;diff=4781&amp;oldid=prev</id>
		<title>Onionmixer: 정오표 수정</title>
		<link rel="alternate" type="text/html" href="https://trans.onionmixer.net/wiki/index.php?title=Smalltalk80LanguageImplementation:Chapter_14&amp;diff=4781&amp;oldid=prev"/>
		<updated>2014-05-09T09:29:37Z</updated>

		<summary type="html">&lt;p&gt;정오표 수정&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:29, 9 May 2014&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l130&quot;&gt;Line 130:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 130:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Tests to see if an object is nil are handled in class Object, but reimplemented in UndefinedObject. In class Object, messages isNil and &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;notNii &lt;/del&gt;are implemented as&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Tests to see if an object is nil are handled in class Object, but reimplemented in UndefinedObject. In class Object, messages isNil and &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;notNil &lt;/ins&gt;are implemented as&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l189&quot;&gt;Line 189:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 189:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|or: alternativeBlock||Nonevaluating disjunction. If the receiver is false, answer the value of the argument; otherwise, answer true without evaluating the argument.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|or: alternativeBlock||Nonevaluating disjunction. If the receiver is false, answer the value of the argument; otherwise, answer true without evaluating the argument.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock||Conditional statement. If the receiver is true, answer the result of evaluating &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;trueAlternativeBtock&lt;/del&gt;; otherwise answer the result of evaluating falseAlternativeBlock.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock||Conditional statement. If the receiver is true, answer the result of evaluating &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;trueAlternativeBlock&lt;/ins&gt;; otherwise answer the result of evaluating falseAlternativeBlock.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|ifFalse: falseAlternativeBlock ifTrue: trueAlternativeBlock||Conditional statement. If the receiver is true, answer the result of evaluating trueAlternativeBlock; otherwise answer the result of evaluating &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;falseAlternativeClock&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|ifFalse: falseAlternativeBlock ifTrue: trueAlternativeBlock||Conditional statement. If the receiver is true, answer the result of evaluating trueAlternativeBlock; otherwise answer the result of evaluating &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;falseAlternativeBlock&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|ifTrue: trueAlternativeBlock||Conditional statement. If the receiver is true, answer the result of evaluating trueAlternativeBlock; otherwise answer nil.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|ifTrue: trueAlternativeBlock||Conditional statement. If the receiver is true, answer the result of evaluating trueAlternativeBlock; otherwise answer nil.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l228&quot;&gt;Line 228:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 228:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     ↑nil&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     ↑nil&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ifFalse: falseAlternativeBlock&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;ifFalse: falseAlternativeBlock&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;↑falseAtternativeBlock &lt;/del&gt;value&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;     &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;↑falseAlternativeBlock &lt;/ins&gt;value&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l384&quot;&gt;Line 384:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 384:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The private initialization method is lights: numberOfLights. Each light is created turned off except for the first light. Then each light is connected to all the other lights (using the message addDependent:). The simulated &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Traffickight &lt;/del&gt;operates by some round robin, perhaps timed, sequencing through each light, turning it on. A simple example shown below creates the &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Traffickight &lt;/del&gt;with the first light on, and then turns on each of the other lights, one at a time. A simulation of a traffic corner might include different models for controlling the lights.   &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The private initialization method is lights: numberOfLights. Each light is created turned off except for the first light. Then each light is connected to all the other lights (using the message addDependent:). The simulated &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;TrafficLight &lt;/ins&gt;operates by some round robin, perhaps timed, sequencing through each light, turning it on. A simple example shown below creates the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;TrafficLight &lt;/ins&gt;with the first light on, and then turns on each of the other lights, one at a time. A simulation of a traffic corner might include different models for controlling the lights.   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Onionmixer</name></author>
	</entry>
	<entry>
		<id>https://trans.onionmixer.net/wiki/index.php?title=Smalltalk80LanguageImplementation:Chapter_14&amp;diff=4780&amp;oldid=prev</id>
		<title>Onionmixer: SMALLTALK80 Chapter 14 Kernel Support 페이지 추가</title>
		<link rel="alternate" type="text/html" href="https://trans.onionmixer.net/wiki/index.php?title=Smalltalk80LanguageImplementation:Chapter_14&amp;diff=4780&amp;oldid=prev"/>
		<updated>2014-04-23T12:27:04Z</updated>

		<summary type="html">&lt;p&gt;SMALLTALK80 Chapter 14 Kernel Support 페이지 추가&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;;Chapter 14 Kernel Support&lt;br /&gt;
&lt;br /&gt;
==Kernel Support==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Object&lt;br /&gt;
&lt;br /&gt;
    Magnitude&lt;br /&gt;
        Character&lt;br /&gt;
        Date&lt;br /&gt;
        Time&lt;br /&gt;
&lt;br /&gt;
        Number&lt;br /&gt;
            Float&lt;br /&gt;
            Fraction&lt;br /&gt;
            Integer&lt;br /&gt;
                LargeNegativeInteger&lt;br /&gt;
                LargePositiveInteger&lt;br /&gt;
                SmallInteger&lt;br /&gt;
&lt;br /&gt;
        LookupKey&lt;br /&gt;
            Association&lt;br /&gt;
&lt;br /&gt;
    Link&lt;br /&gt;
&lt;br /&gt;
        Process&lt;br /&gt;
&lt;br /&gt;
    Collection&lt;br /&gt;
&lt;br /&gt;
        SequenceableCollection&lt;br /&gt;
            LinkedList&lt;br /&gt;
&lt;br /&gt;
                Semaphore&lt;br /&gt;
&lt;br /&gt;
            ArrayedCollection&lt;br /&gt;
                Array&lt;br /&gt;
&lt;br /&gt;
                Bitmap&lt;br /&gt;
                    DisplayBitmap&lt;br /&gt;
&lt;br /&gt;
                RunArray&lt;br /&gt;
                String&lt;br /&gt;
                    Symbol&lt;br /&gt;
                Text&lt;br /&gt;
                ByteArray&lt;br /&gt;
&lt;br /&gt;
            Interval&lt;br /&gt;
            OrderedCollection&lt;br /&gt;
                SortedCollection&lt;br /&gt;
        Bag&lt;br /&gt;
        MappedCollection&lt;br /&gt;
        Set&lt;br /&gt;
            Dictionary&lt;br /&gt;
                IdentifyDictionary&lt;br /&gt;
&lt;br /&gt;
    Stream&lt;br /&gt;
        PositionableStream&lt;br /&gt;
            ReadStream&lt;br /&gt;
            WriteStream&lt;br /&gt;
                ReadWriteStream&lt;br /&gt;
                    ExternalStream&lt;br /&gt;
                        FileStream&lt;br /&gt;
&lt;br /&gt;
        Random&lt;br /&gt;
&lt;br /&gt;
    File&lt;br /&gt;
    FileDirectory&lt;br /&gt;
    FilePage&lt;br /&gt;
&lt;br /&gt;
    UndefinedObject***&lt;br /&gt;
    Boolean***&lt;br /&gt;
        False***&lt;br /&gt;
        True***&lt;br /&gt;
&lt;br /&gt;
    ProcessorScheduler&lt;br /&gt;
    Delay&lt;br /&gt;
    SharedQueue&lt;br /&gt;
&lt;br /&gt;
    Behavior&lt;br /&gt;
        ClassDescription&lt;br /&gt;
            Class&lt;br /&gt;
            MetaClass&lt;br /&gt;
&lt;br /&gt;
    Point&lt;br /&gt;
    Rectangle&lt;br /&gt;
    BitBit&lt;br /&gt;
        CharacterScanner&lt;br /&gt;
&lt;br /&gt;
        Pen&lt;br /&gt;
&lt;br /&gt;
    DisplayObject&lt;br /&gt;
        DisplayMedium&lt;br /&gt;
            Form&lt;br /&gt;
                Cursor&lt;br /&gt;
                DisplayScreen&lt;br /&gt;
        InfiniteForm&lt;br /&gt;
        OpaqueForm&lt;br /&gt;
        Path&lt;br /&gt;
            Arc&lt;br /&gt;
                Circle&lt;br /&gt;
            Curve&lt;br /&gt;
            Line&lt;br /&gt;
            LinearFit&lt;br /&gt;
            Spline&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Class UndefinedObject==&lt;br /&gt;
&lt;br /&gt;
The object nil represents a value for uninitialized variables. It also represents meaningless results. It is the only instance of class UndefinedObject.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The purpose of including class UndefinedObject in the system is to handle error messages.The typical error in evaluating Smal]talk-80 expressions is that some object is sent a message it does not understand. Often this occurs because a variable is not properly initialized--in many cases, the variable name that should refer to some other object refers to nil instead. The error message is of the form&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
className does not understand messageSelector&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
where className mentions the class of the receiver and messageSelector is the selector of the erroneously-sent message.&lt;br /&gt;
Note, if nil were an instance of Object, then a message sent to it in error would state&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
Object does not understand messageSelector&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
which is less explicit than stating that an undefined object does not understand the message. At the price of a class description, it was possible to improve on the error message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Tests to see if an object is nil are handled in class Object, but reimplemented in UndefinedObject. In class Object, messages isNil and notNii are implemented as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
isNil&lt;br /&gt;
    ↑false&lt;br /&gt;
notNil&lt;br /&gt;
    ↑true&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In class UndefinedObject, messages isNil and notNil are implemented as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
isNil&lt;br /&gt;
    ↑true&lt;br /&gt;
notNil&lt;br /&gt;
    ↑false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
so that no conditional test in Object is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Classes Boolean, True, and False==&lt;br /&gt;
&lt;br /&gt;
Protocol for logical values is provided by the class Boolean; logical values are represented by subclasses of Boolean~True and False. The subclasses add no new protocol; they reimplement many messages to have better performance than the methods in the superclass. The idea is similar to that in testing for nil in Object and UndefinedObject; true knows that it represents logical truth and false knows that it represents logical falsehood. We show the implementation of some of the controlling protocol to illustrate this idea.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The logical operations are&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border: 1px solid black;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;color: white; background-color: black;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |logical operations&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|&amp;amp; aBoolean||Evaluating conjunction. Answer true if both the receiver and the argument are true.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|&amp;amp;#124; aBoolean||Evaluating disjunction. Answer true if either the receiver or the argument is true.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|not||Negation. Answer true if the receiver is false, answer false if the receiver is true.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|eqv: aBoolean||Answer true if the receiver is equivalent to the argument, aBoolean.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|xor: aBoolean||Exclusive OR. Answer true if the receiver is not equivalent to aBoolean.&lt;br /&gt;
|- style=&amp;quot;color: black; background-color: gray;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Boolean instance protocol&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
These conjunction and disjunction operations are &amp;quot;evaluating&amp;quot; --this means that the argument is evaluated regardless of the value of the receiver. This is in contrast to and: and or: in which the receiver determines whether to evaluate the argument.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border: 1px solid black;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;color: white; background-color: black;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |controlling&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|and: alternativeBlock||Nonevaluating conjunction. If the receiver is true, answer the value of the argument; otherwise, answer false without evaluating the argument.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|or: alternativeBlock||Nonevaluating disjunction. If the receiver is false, answer the value of the argument; otherwise, answer true without evaluating the argument.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock||Conditional statement. If the receiver is true, answer the result of evaluating trueAlternativeBtock; otherwise answer the result of evaluating falseAlternativeBlock.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|ifFalse: falseAlternativeBlock ifTrue: trueAlternativeBlock||Conditional statement. If the receiver is true, answer the result of evaluating trueAlternativeBlock; otherwise answer the result of evaluating falseAlternativeClock.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|ifTrue: trueAlternativeBlock||Conditional statement. If the receiver is true, answer the result of evaluating trueAlternativeBlock; otherwise answer nil.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|ifFalse: falseAlternativeBlock||Conditional statement. If the receiver is false, answer the result of evaluating falseAlternativeBlock; otherwise answer nil.&lt;br /&gt;
|- style=&amp;quot;color: black; background-color: gray;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Boolean instance protocol&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The arguments to and: and or: must be blocks in order to defer evaluation. Conditional statements are provided as messages ifTrue:ifFalse:, ifFalse:ifTrue:, ifTrue:, and ifFalse:, as already specified and exemplified throughout the previous chapters. The messages are implemented in the subclasses of class Boolean so that the appropriate argument block is evaluated.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In class True, the methods are&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock&lt;br /&gt;
    ↑trueAlternativeBlock value&lt;br /&gt;
ifFalse: falseAlternativeBlock ifTrue: trueAlternativeBlock&lt;br /&gt;
    ↑trueAlternativeBlock value&lt;br /&gt;
ifTrue: trueAlternativeBlock&lt;br /&gt;
    ↑trueAlternativeBlock value&lt;br /&gt;
ifFalse: falseAlternativeBlock&lt;br /&gt;
    ↑nil&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In class False, the methods are&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
ifTrue: trueAlternativeBlock ifFalse: falseAlternativeBlock&lt;br /&gt;
    ↑falseAlternativeBlock value&lt;br /&gt;
ifFalse: falseAlternativeBlock ifTrue: trueAlternativeBlock&lt;br /&gt;
    ↑falseAlternativeBlock value&lt;br /&gt;
ifTrue: trueAlternativeBlock&lt;br /&gt;
    ↑nil&lt;br /&gt;
ifFalse: falseAlternativeBlock&lt;br /&gt;
    ↑falseAtternativeBlock value&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If x is 3, then&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
x &amp;gt; 0 ifTrue: [x ← X - 1] ifFalse: [x ← x + 1]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
is interpreted as x &amp;gt; 0 evaluates to true, the sole instance of class True; the method for ifTrue:ifFalse: is found in class True, so the block [x ← x - 1] is evaluated without further testing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this way, the message lookup mechanism provides an effective implementation of conditional control with no additional primitive operations or circular definitions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Additional Protocol for Class Object==&lt;br /&gt;
&lt;br /&gt;
Protocol for class Object, shared by all objects, was introduced in Chapter 6. Several categories of messages were not included in that early discussion. Most of these are part of Object&amp;#039;s protocol to provide system support for message handling, dependence relationships, primitive message handling, and system primitives.&lt;br /&gt;
&lt;br /&gt;
===Dependence Relationships Among Objects===&lt;br /&gt;
&lt;br /&gt;
Information in the Smalltalk-80 system is represented by objects. The variables of objects themselves refer to objects; in this sense, objects are explicitly related or dependent on one another. Classes are related to their superclasses and metaclasses; these classes share external and internal descriptions and are thereby dependent on one another. These forms of dependency are central to the semantics of the Smalltalk-80 language. They coordinate descriptive information among objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An additional kind of dependency is supported in class Object. Its purpose is to coordinateactivities among different objects. Specifically, its purpose is to be able to link one object, say A, to one or more other objects, say B, so B can be informed if A changes in any way. Upon being informed when A changes and the nature of the change, B can decide to take some action such as updating its own status. The concept of changeand update,therefore, are integral to the support of this third kind of object dependence relationship.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The protocol in class Object is&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border: 1px solid black;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;color: white; background-color: black;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |dependents access&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|addDependent: anObject||Add the argument, anObject, as one of the receiver&amp;#039;s dependents.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|removeDependent: anObject||Remove the argument, anObject, as one of the receiver&amp;#039;s dependents.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|dependents||Answer an OrderedCollection of the objects that are dependent on the receiver, that is, the objects that should be notified if the receiver changes.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|release||Remove references to objects that may refer back to the receiver. This message is reimplemented by any subclass that creates references to dependents; the expression super release is included in any such reimplementation.&lt;br /&gt;
|- style=&amp;quot;color: white; background-color: black;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |change and update&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|changed||The receiver changed in some general way; inform all the dependents by sending each dependent an update: message.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|changed: aParameter||The receiver changed; the change is denoted by the argument, aParameter. Usually the argument is a Symbol that is part of the dependent&amp;#039;s change protocol; the default behavior is to use the receiver itself as the argument. Inform all of the dependents.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|update: aParameter||An object on whom the receiver is dependent has changed. The receiver updates its status accordingly (the default behavior is to do nothing).&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|broadcast: aSymbol||Send the argument, aSymbol, as a unary message to all of the receiver&amp;#039;s dependents.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|broadcast: aSymbol with: anObject||Send the argument, aSymbol, as a keyword message with argument, anObject, to all of the receiver&amp;#039;s dependents.&lt;br /&gt;
|- style=&amp;quot;color: black; background-color: gray;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Object instance protocol&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Take, as an example, the objects that model traffic lights. A typical traffic light at a street corner is an object with three lights, each a different color. Only one of these lights can be ON at a given moment. In this sense, the ON-OFF status of each of the three lights is dependent on the status of the other two. There are a number of ways to create this relationship. Suppose we create the class Light as follows.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border: 0px solid black;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|class name||Light&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|superclass||Object&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|instance variable names||status&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|class methods&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
instance creation&lt;br /&gt;
    setOn&lt;br /&gt;
        ↑self new setOn&lt;br /&gt;
    setOff&lt;br /&gt;
        ↑self new setOff&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|instance methods&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
status&lt;br /&gt;
    turnOn&lt;br /&gt;
        self isOff&lt;br /&gt;
            ifTrue: [status ← true. self changed]&lt;br /&gt;
    turnOff&lt;br /&gt;
        self isOn&lt;br /&gt;
            ifTrue: [status ← false]&lt;br /&gt;
&lt;br /&gt;
testing&lt;br /&gt;
    isOn&lt;br /&gt;
        ↑status&lt;br /&gt;
    isOff&lt;br /&gt;
        ↑status not&lt;br /&gt;
&lt;br /&gt;
change and update&lt;br /&gt;
    update: aLight&lt;br /&gt;
        aLight = = self ifFalse: [self turnOff]&lt;br /&gt;
&lt;br /&gt;
private&lt;br /&gt;
    setOn&lt;br /&gt;
        status ← true&lt;br /&gt;
    setOff&lt;br /&gt;
        status ← false&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The model is very simple. A Light is either on or off, so a status flag is kept as an instance variable; it is true if the Light is on, false if the Light is off. Whenever a Light is turned on (turnOn), it sends itself the changed message. Any other status change is not broadcast to the dependents on the assumption that a Light is turned off in reaction to turning on another Light. The default response to changed is to send all dependents the message update: self (i.e., the object that changed is the argument to the update: message). Then update: is implemented in Light to mean turn off. If the parameter is the receiver, then, of course, the update: is ignored.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The class TrafficLight is defined to set up any number of coordinated lights. The instance creation message with: takes as its argument the number of Lights to be created. Each Light is dependent on all other Lights. When the TrafficLight is demolished, the dependencies among its Lights are disconnected (the message inherited from class Object for disconnecting dependents is release; it is implemented in TrafficLight in order to broadcast the message to all Lights).&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border: 0px solid black;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|class name||TrafficLight&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|superclass||Object&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|instance variable names||lights&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|class methods&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
instance creation&lt;br /&gt;
    with: numberOfLights&lt;br /&gt;
        ↑self new lights: numberOfLights&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|instance methods&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
operate&lt;br /&gt;
    turnOn: lightNumber&lt;br /&gt;
        (lights at: lightNumber) turnOn&lt;br /&gt;
&lt;br /&gt;
initialize-release&lt;br /&gt;
    release&lt;br /&gt;
        super release.&lt;br /&gt;
        lights do: [ :eachLight | eachLight release].&lt;br /&gt;
        lights ← nil&lt;br /&gt;
&lt;br /&gt;
private&lt;br /&gt;
    lights: numberOfLights&lt;br /&gt;
        lights ← Array new: (numberOfLights max: 1).&lt;br /&gt;
        lights at: 1 put: Light setOn.&lt;br /&gt;
        2 to: numberOfLights do:&lt;br /&gt;
            [ :index | lights at: index put: Light setOff].&lt;br /&gt;
        lights do:&lt;br /&gt;
            [ :eachLight |&lt;br /&gt;
                lights do:&lt;br /&gt;
                    [ :dependentLight |&lt;br /&gt;
                        eachLight ~~ dependentLight&lt;br /&gt;
                            ifTrue: [eachLight addDependent: dependentLight]]]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The private initialization method is lights: numberOfLights. Each light is created turned off except for the first light. Then each light is connected to all the other lights (using the message addDependent:). The simulated Traffickight operates by some round robin, perhaps timed, sequencing through each light, turning it on. A simple example shown below creates the Traffickight with the first light on, and then turns on each of the other lights, one at a time. A simulation of a traffic corner might include different models for controlling the lights.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
trafficLight ← TrafficLight with: 3.&lt;br /&gt;
trafficLight turnOn: 2.&lt;br /&gt;
trafficLight turnOn: 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The message turnOn: to a TrafficLight sends the message turnOn to the designated Light. If the Light is currently off, then it is set on and the message changed sent. The message changed sends update: to each dependent Light; if a dependent light is on, it is turned off.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A particularly important use of this dependency protocol is to support having multiple graphical images of an object. Each image is dependent on the object in the sense that, if the object changes, the image must be informed so that it can decide whether the change affects the displayed information. The user interface to the Smalltalk-80 system makes liberal use of this support for broadcasting notices that an object has changed; this is used to coordinate the contents of a sequence of menus of possible actions that the user can take with respect to the contents of information displayed on the screen. Menus themselves can be created by linking possible actions together, in a way similar to the way we linked together the traffic lights.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Message Handling===&lt;br /&gt;
&lt;br /&gt;
ll processing in the Smalltalk-80 system is carried out by sending messages to objects. For reasons of efficiency, instances of class Message are only created when an error occurs and the message state must be stored in an accessible structure. Most messages in the system, therefore, do not take the form of directly creating an instance of Message and transmitting it to an object.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In some circumstances, it is useful to compute the message selector of a message transmission. For example, suppose that a list of possible message selectors is kept by an object and, based on a computation, one of these selectors is chosen. Suppose it is assigned as a value of a variable selector. Now we wish to transmit the message to some object, say, to receiver. We can not simply write the expression as&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
receiver selector&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
because this means--send the object referred to by receiver the unary message selector. We could, however, write&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
receiver perform: selector&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The result is to transmit the value of the argument, selector, as the message to receiver. Protocol to support this ability to send a computed message to an object is provided in class Object. This protocol includes methods for transmitting computed keyword as well as unary messages.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border: 1px solid black;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;color: white; background-color: black;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |message handling&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|perform: aSymbol||Send the receiver the unary message indicated by the argument, aSymbol.The argument is the selector of the message. Report an error if the number of arguments expected by the selector is not zero.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|perform:aSymbol with: anObject||Send the receiver the keyword message indicated by the arguments. The first argument, aSymbol, is the selector of the message. The other argument, anObject, is the argument of the message to be sent. Report an error if the number of arguments expected by the selector is not one.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|perform: aSymbol with: firstObject with: secondObject||Send the receiver the keyword message indicated by the arguments. The first argument, aSymbol, is the selector of the message. The other arguments, firstObject and secondObject, are the arguments of the message to be sent. Report an error if the number of arguments expected by the selector is not two.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|perform: aSymbol with: firstObject with: secondObject with: thirdObject||Send the receiver the keyword message indicated by the arguments. The first argument, aSymbol, is the selector of the message. The other arguments, firstObject, secondObject, and thirdObject, are the arguments of the message to be sent. Report an error if the number of arguments expected by the selector is not three.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|perform: selector withArguments: anArray||Send the receiver the keyword message indicated by the arguments. The argument, selector, is the selector of the message. The arguments of the message are the elements of anArray. Report an error if the number of arguments expected by the selector is not the same as the size of anArray.&lt;br /&gt;
|- style=&amp;quot;color: black; background-color: gray;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Object instance protocol&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
One way in which this protocol can be used is as a decoder of user commands. Suppose for example that we want to model a very simple calculator in which operands precede operators. A possible implementation represents the calculator as having (1) the current result, which is also the first operand, and (2) a possibly undefined second operand. Each operator is a message selector understood by the result. Sending the message clear, once, resets the operand; sending the message clear when the operand is reset will reset the result.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border: 0px solid black;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|class name||Calculator&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|superclass||Object&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|instance variable names||result&amp;lt;br&amp;gt;operand&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|class methods&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
instance creation&lt;br /&gt;
    new&lt;br /&gt;
        ↑super new initialize&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|instance methods&lt;br /&gt;
|&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
accessing&lt;br /&gt;
    result&lt;br /&gt;
        ↑result&lt;br /&gt;
&lt;br /&gt;
calculating&lt;br /&gt;
    apply: operator&lt;br /&gt;
        (self respondsTo: operator)&lt;br /&gt;
            ifFalse: [self error: &amp;#039;operation not understood&amp;#039;].&lt;br /&gt;
        operand isNil&lt;br /&gt;
            ifTrue: [result ← result perform: operator]&lt;br /&gt;
            ifFalse: [result ← result perform: operator with: operand]&lt;br /&gt;
    clear&lt;br /&gt;
        operand isNil&lt;br /&gt;
            ifTrue: [result ← 0]&lt;br /&gt;
            ifFalse; [operand ← nil]&lt;br /&gt;
    operand: aNumber&lt;br /&gt;
        operand ← aNumber&lt;br /&gt;
&lt;br /&gt;
private&lt;br /&gt;
    initialize&lt;br /&gt;
        result ← 0&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An example illustrates the use of the class Calculator.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
hp ← Calculator new&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Create hp as a Calculator. The instance variables are initialized with result 0 and operand nil.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
hp operand: 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Imagine the user has pressed the key labeled 3 and set the operand.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
hp apply: #+&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The user selects addition. The method for apply determines that the operator is understood and that the operand is not nil; therefore, the result is set by the expression&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
result perform: operator with: operand&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
which is equivalent to&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
0 + 3&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The methods sets result to 3; operand remains 3 so that&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
hp apply: #+&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
again adds 3, so the result is now 6.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
hp operand: 1.&lt;br /&gt;
hp apply: #-.&lt;br /&gt;
hp clear.&lt;br /&gt;
hp apply: #squared&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The result was 6, subtract 1, and compute the square; result is now 25.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===System Primitive Messages===&lt;br /&gt;
&lt;br /&gt;
There are a number of messages specified in class Object whose purpose is to support the needs of the overall system implementation. They are categorized as system primitives. These are messages that provide direct access to the state of an instance and, to some extent, violate the principle that each object has sovereign control over storing values into its variables. However, this access is needed by the language interpreter. It is useful in providing class description/development utilities for the programming environment. Examples of these messages are instVarAt: anInteger and instVarAt: anInteger put: anObject which retrieve and store the values of named instance variables, respectively.&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border: 1px solid black;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;color: white; background-color: black;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |system primitives&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|become: otherObject||Swap the instance pointers of the receiver and the argument, otherObject. All variables in the entire system that pointed to the receiver will now point to the argument and vice versa. Report an error if either object is a SmallInteger.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|instVarAt: index||Answer a named variable in the receiver. The numbering of the variables corresponds to the order in which the named instance variables were defined.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|instVarAt: index put: value||Store the argument, value, into a named variable in the receiver. The number of variables corresponds to the order in which the named instance variables were defined. Answer value.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|nextInstance||Answer the next instance after the receiver in the enumeration of all instances of this class. Answer nil if all instances have been enumerated.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|numberOfPointers||Answer the number of objects to which the receiver refers.&lt;br /&gt;
|- style=&amp;quot;vertical-align:top;&amp;quot;&lt;br /&gt;
|refct||Answer the number of object pointers in the system that point at the receiver. Answer O if the receiver is a SmallInteger.&lt;br /&gt;
|- style=&amp;quot;color: black; background-color: gray;&amp;quot;&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot; |Object instance protocol&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Probably the most unusual and effective of the system primitive messages is the message become: otherObject. The response to this message is to swap the instance pointer of the receiver with that of the argument, otherObject. An example of the use of this message is found in the implementation of the message grow in several of the collection classes. The message grow is sent when the number of elements that can be stored in a (fixed-length) collection have to be increased without copyingthe collection; copying is undesirable because all shared references to the collection must be preserved. Thus a new collection is created, its elements stored, and then the original collection transforms into (becomes) the new one. All pointers to the original collection are replaced by pointers to the new one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following is the method for grow as specified in class SequenceableCollection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;smalltalk&amp;quot;&amp;gt;&lt;br /&gt;
grow&lt;br /&gt;
    | newCollection |&lt;br /&gt;
    newCollection ← self species new: self size + self growSize.&lt;br /&gt;
    newCollection replaceFrom: 1 to: self size with: self.&lt;br /&gt;
    ↑self become: newCollection&lt;br /&gt;
growSize&lt;br /&gt;
    ↑10&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Subclasses can redefine the response to the message growSize in order to specify alternative numbers of elements by which to expand.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Smalltalk80LanguageImplementation]]&lt;/div&gt;</summary>
		<author><name>Onionmixer</name></author>
	</entry>
</feed>