<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.compsci.ca/skins/common/feed.css?270"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.compsci.ca/index.php?action=history&amp;feed=atom&amp;title=An_Introduction_to_Io</id>
		<title>An Introduction to Io - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.compsci.ca/index.php?action=history&amp;feed=atom&amp;title=An_Introduction_to_Io"/>
		<link rel="alternate" type="text/html" href="http://wiki.compsci.ca/index.php?title=An_Introduction_to_Io&amp;action=history"/>
		<updated>2026-04-15T04:13:49Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.16.0</generator>

	<entry>
		<id>http://wiki.compsci.ca/index.php?title=An_Introduction_to_Io&amp;diff=3229&amp;oldid=prev</id>
		<title>Dan at 14:08, 11 June 2007</title>
		<link rel="alternate" type="text/html" href="http://wiki.compsci.ca/index.php?title=An_Introduction_to_Io&amp;diff=3229&amp;oldid=prev"/>
				<updated>2007-06-11T14:08:03Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 14:08, 11 June 2007&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 579:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 579:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Discussion==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Discussion==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;To Discuss this tutorial visit [http://www.compsci.ca/v2/viewtopic.php?t=10795 here].&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;To Discuss this tutorial visit [http://www.compsci.ca/v2/viewtopic.php?t=10795 here].&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; 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='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Credits==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Credits==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Tutorial written by [[wtd]], moved to wiki by [[TheFerret]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Tutorial written by [[wtd]], moved to wiki by [[TheFerret]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dan</name></author>	</entry>

	<entry>
		<id>http://wiki.compsci.ca/index.php?title=An_Introduction_to_Io&amp;diff=2106&amp;oldid=prev</id>
		<title>Hikaru79: Added link</title>
		<link rel="alternate" type="text/html" href="http://wiki.compsci.ca/index.php?title=An_Introduction_to_Io&amp;diff=2106&amp;oldid=prev"/>
				<updated>2006-01-04T05:05:17Z</updated>
		
		<summary type="html">&lt;p&gt;Added link&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 05:05, 4 January 2006&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 573:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 573:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==&amp;gt; method(other, (self ==(other)) isNil)&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==&amp;gt; method(other, (self ==(other)) isNil)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; 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;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;==Where to Find Io==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Io can be downloaded from http://www.iolanguage.com as source code, or precompiled binaries for most operating systems.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Discussion==&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;==Discussion==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Hikaru79</name></author>	</entry>

	<entry>
		<id>http://wiki.compsci.ca/index.php?title=An_Introduction_to_Io&amp;diff=2097&amp;oldid=prev</id>
		<title>24.226.98.236: fixed credits/discussion</title>
		<link rel="alternate" type="text/html" href="http://wiki.compsci.ca/index.php?title=An_Introduction_to_Io&amp;diff=2097&amp;oldid=prev"/>
				<updated>2006-01-02T02:57:49Z</updated>
		
		<summary type="html">&lt;p&gt;fixed credits/discussion&lt;/p&gt;
&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
		&lt;tr valign='top'&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
		&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 02:57, 2 January 2006&lt;/td&gt;
		&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 574:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 574:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;''Originally created by [[Wtd]] at &lt;/del&gt;[http://www.compsci.ca/v2/viewtopic.php?t=10795 &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;the forums&lt;/del&gt;], &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;copied over &lt;/del&gt;by [[TheFerret]]&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;''&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;==Discussion==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;To Discuss this tutorial visit &lt;/ins&gt;[http://www.compsci.ca/v2/viewtopic.php?t=10795 &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;here].&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;==Credits==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Tutorial written by [[wtd]&lt;/ins&gt;], &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;moved to wiki &lt;/ins&gt;by [[TheFerret]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>24.226.98.236</name></author>	</entry>

	<entry>
		<id>http://wiki.compsci.ca/index.php?title=An_Introduction_to_Io&amp;diff=2096&amp;oldid=prev</id>
		<title>TheFerret: Created the page</title>
		<link rel="alternate" type="text/html" href="http://wiki.compsci.ca/index.php?title=An_Introduction_to_Io&amp;diff=2096&amp;oldid=prev"/>
				<updated>2006-01-02T02:53:01Z</updated>
		
		<summary type="html">&lt;p&gt;Created the page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Why another programming language?==&lt;br /&gt;
&lt;br /&gt;
We've all heard the expression &amp;quot;think outside the box.&amp;quot; It means that you shouldn't allow your thinking to be limited by what you're accustomed to.&lt;br /&gt;
&lt;br /&gt;
Every single programming language forces us to think inside a box. Some of the boxes are smaller, and some are larger, but they're still boxes. The only way to gain a broad understanding of programming then, is to learn as many programming languages as we can.&lt;br /&gt;
&lt;br /&gt;
===Why this programming language?===&lt;br /&gt;
&lt;br /&gt;
Students stumble over two things when learning a programming language. They either have trouble with the syntax or the semantics. How the language looks, or how it behaves.&lt;br /&gt;
&lt;br /&gt;
Syntax is not without importance. Finding easier ways to do things is good. But syntactic conveniences are generally just a sign of support for beneficial semantics.&lt;br /&gt;
&lt;br /&gt;
In functional programming languages we don't say the ability to pass around anonymous functions is useful because of the syntax.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
\x -&amp;gt; x * 3 + 16&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is useful because of the utility of being able to quickly generate functions and pass them around as values. It is an idea we can use elsewhere to our advantage. The syntax we'll rarely be able to use.&lt;br /&gt;
&lt;br /&gt;
Io is a programming language with minimal syntactic rules. There is very little to trip over because there just isn't much there. This emphasizes semantics.&lt;br /&gt;
&lt;br /&gt;
===So what the heck is Io?===&lt;br /&gt;
&lt;br /&gt;
Io is a purely object-oriented programming language. Everything in Io is an object.&lt;br /&gt;
&lt;br /&gt;
What does that mean? Well, simply put, it means the language is consistent.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; &amp;quot;hello&amp;quot; size&lt;br /&gt;
==&amp;gt; 5&lt;br /&gt;
Io&amp;gt; list(1, 2, 3) size&lt;br /&gt;
==&amp;gt; 3&lt;br /&gt;
Io&amp;gt; &amp;quot;hello&amp;quot; foreach(i, x,&lt;br /&gt;
       writeln(i, &amp;quot;: &amp;quot;, x asCharacter)&lt;br /&gt;
    )&lt;br /&gt;
0: h&lt;br /&gt;
1: e&lt;br /&gt;
2: l&lt;br /&gt;
3: l&lt;br /&gt;
4: o&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; Nil&lt;br /&gt;
Io&amp;gt; list(1, 2, 3) foreach(i, x,&lt;br /&gt;
       writeln(i, &amp;quot;: &amp;quot;, x)&lt;br /&gt;
    )&lt;br /&gt;
0: 1&lt;br /&gt;
1: 2&lt;br /&gt;
2: 3&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; Nil&lt;br /&gt;
Io&amp;gt; &amp;quot;hello&amp;quot; print&lt;br /&gt;
hello&lt;br /&gt;
==&amp;gt; hello&lt;br /&gt;
Io&amp;gt; 9 print&lt;br /&gt;
9&lt;br /&gt;
==&amp;gt; 9&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A big plus is that Io features an interactive interpreter, making it easy to experiment with code.&lt;br /&gt;
&lt;br /&gt;
And that probably doesn't tell you a whole lot, so let's be a bit more specific.&lt;br /&gt;
&lt;br /&gt;
==Hello, world==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; writeln(&amp;quot;hello, world&amp;quot;)&lt;br /&gt;
hello, world&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; Nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What's going on here?&lt;br /&gt;
&lt;br /&gt;
Well, &amp;quot;writeln&amp;quot; is a message.&lt;br /&gt;
&lt;br /&gt;
A message has a receiver, and optionally, arguments. At the top level of a program, the receiver is implicitly Object. Therefore we can easily write the following instead.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; Object writeln(&amp;quot;Hello, world&amp;quot;)&lt;br /&gt;
Hello, world&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; Nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The argument in this case is the string, &amp;quot;Hello, world&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
When the &amp;quot;writeln&amp;quot; message is sent to Object, it looks up the corresponding method and invokes it with the arguments supplied.&lt;br /&gt;
&lt;br /&gt;
Message passing is not so obvious until you see the same action performed as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; perform(&amp;quot;writeln&amp;quot;, &amp;quot;Hello, world&amp;quot;)&lt;br /&gt;
Hello, world&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; Nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Programming Principles==&lt;br /&gt;
===What about math and stuff?===&lt;br /&gt;
&lt;br /&gt;
Operators exist, and are quite handy for all of our mathematical needs. They also follow the same precendence rules you're used to.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; 1 + 1&lt;br /&gt;
==&amp;gt; 2&lt;br /&gt;
Io&amp;gt; 2 + 3 * 4&lt;br /&gt;
==&amp;gt; 14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, how does this mesh with the idea of messages and consistency?&lt;br /&gt;
&lt;br /&gt;
Well, let's rewrite the above.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; 1 +(1)&lt;br /&gt;
==&amp;gt; 2&lt;br /&gt;
Io&amp;gt; 2 +(3 *(4))&lt;br /&gt;
==&amp;gt; 14&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It's just kind of ugly to do it that way.&lt;br /&gt;
&lt;br /&gt;
===Variables?===&lt;br /&gt;
&lt;br /&gt;
It's not unusual to want to give names to pieces of information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; msg := &amp;quot;Hello, world&amp;quot;&lt;br /&gt;
==&amp;gt; Hello, world&lt;br /&gt;
Io&amp;gt; writeln(msg)&lt;br /&gt;
Hello, world&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; Nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But what's really going on here?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; Object writeln(Object msg)&lt;br /&gt;
Hello, world&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; Nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As with writeln, Object is implicitly there.&lt;br /&gt;
&lt;br /&gt;
Thus &amp;quot;msg&amp;quot; becomes just a value tied to a &amp;quot;slot&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===A receiver other than Object?===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; msg println&lt;br /&gt;
Hello, world&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; Hello, world&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here msg is the receiver, and println the message. Of course, the implicit Object is still in there.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; Object msg println&lt;br /&gt;
Hello, world&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; Hello, world&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Perhaps this is easier to understand as follows.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; (Object msg) println&lt;br /&gt;
Hello, world&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; Hello, world&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The println message is being sent to &amp;quot;Object msg&amp;quot;. Get used to the version without parentheses, thogh, since that's what you'll see from here on out.&lt;br /&gt;
&lt;br /&gt;
===Create your own method===&lt;br /&gt;
&lt;br /&gt;
So far we've only seen a very few standard library provided methods. Let's create one.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; sayHello := method(&amp;quot;Hello&amp;quot; println)&lt;br /&gt;
==&amp;gt; method(&amp;quot;Hello&amp;quot; println)&lt;br /&gt;
Io&amp;gt; sayHello&lt;br /&gt;
Hello&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; Hello&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There's nothing new here. The := and method are both messages. The following is a more verbose version.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; Object sayHello := Object method(&amp;quot;Hello&amp;quot; println)&lt;br /&gt;
==&amp;gt; method(&amp;quot;Hello&amp;quot; println)&lt;br /&gt;
Io&amp;gt; Object sayHello&lt;br /&gt;
Hello&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; Hello&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Let's add an argument.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; sayHelloTo := method(name, writeln(&amp;quot;Hello &amp;quot;, name))&lt;br /&gt;
==&amp;gt; method(name, writeln(&amp;quot;Hello &amp;quot;, name))&lt;br /&gt;
Io&amp;gt; sayHelloTo(&amp;quot;Bob&amp;quot;)&lt;br /&gt;
Hello Bob&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; Nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
What if the method has lots of arguments?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; sayHelloTo := method(&lt;br /&gt;
       thisMessage arguments foreach(arg,&lt;br /&gt;
          writeln(&amp;quot;Hello &amp;quot;, doMessage(arg))&lt;br /&gt;
       )&lt;br /&gt;
    )&lt;br /&gt;
==&amp;gt; method(thisMessage arguments foreach(arg, writeln(&amp;quot;Hello &amp;quot;, doMessage(arg))))&lt;br /&gt;
Io&amp;gt; sayHelloTo(&amp;quot;Bob&amp;quot;)&lt;br /&gt;
Hello Bob&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; Nil&lt;br /&gt;
Io&amp;gt; sayHelloTo(&amp;quot;Bob&amp;quot;, &amp;quot;John&amp;quot;)&lt;br /&gt;
Hello Bob&lt;br /&gt;
Hello John&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; Nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, what's going on here? What is &amp;quot;thisMessage&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
That refers to well, the current message. In the case of:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sayHelloTo(&amp;quot;Bob&amp;quot;, &amp;quot;John&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It refers to that passing of the sayHelloTo message. The arguments slot of that object contains a list which holds the arguments. It's fairly straightforward.&lt;br /&gt;
&lt;br /&gt;
For that list, we send the &amp;quot;foreach&amp;quot; message. For each argument in that list, evaluate the message. Of course, here we're sending two arguments to &amp;quot;foreach&amp;quot;, so the first is the name we're giving to each argument in the list.&lt;br /&gt;
&lt;br /&gt;
So, why can't we just write the following?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
writeln(&amp;quot;Hello &amp;quot;, arg)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The arguments in the list are not simple values. They're actually objects which represent the messages themselves, before being evaluated. To evaluate those messages and get the resulting value, we can use the doMessage message.&lt;br /&gt;
&lt;br /&gt;
How it all comes together is reasonable straightforward.&lt;br /&gt;
&lt;br /&gt;
===A conditional===&lt;br /&gt;
&lt;br /&gt;
What if we want it to print &amp;quot;Hello world&amp;quot; if no arguments were passed in?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; sayHelloTo := method(&lt;br /&gt;
       args := thisMessage arguments&lt;br /&gt;
       if(args size == 0,&lt;br /&gt;
          &amp;quot;Hello world&amp;quot; println&lt;br /&gt;
          return(Nil)&lt;br /&gt;
       )&lt;br /&gt;
       args foreach(arg,&lt;br /&gt;
          writeln(&amp;quot;Hello &amp;quot;, doMessage(arg))&lt;br /&gt;
       )&lt;br /&gt;
    )&lt;br /&gt;
==&amp;gt; method(setSlot(&amp;quot;args&amp;quot;, thisMessage arguments);&lt;br /&gt;
if(args size ==(0), &amp;quot;Hello world&amp;quot; println;&lt;br /&gt;
return(Nil));&lt;br /&gt;
args foreach(arg, writeln(&amp;quot;Hello &amp;quot;, doMessage(arg))))&lt;br /&gt;
Io&amp;gt; sayHelloTo&lt;br /&gt;
Hello world&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; Nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here we can see first off the addition of the &amp;quot;args&amp;quot; slot to give a more convenient name to the arguments list.&lt;br /&gt;
&lt;br /&gt;
The next new thing of course is the conditional. If there are no arguments to sayHelloTo, then we first print &amp;quot;Hello world&amp;quot; and then we send the return message with the argument Nil. The return message causes control flow to skip to the end of the method.&lt;br /&gt;
&lt;br /&gt;
It's interesting to note that multiple messages here are considered as a single message by the if message. They are separated by a newline, but could be separated by a semi-colon, as the code after &amp;quot;==&amp;gt;&amp;quot; shows.&lt;br /&gt;
&lt;br /&gt;
Now here we're only providing two arguments to &amp;quot;if&amp;quot;. We could provide three.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; sayHelloTo := method(&lt;br /&gt;
       args := thisMessage arguments&lt;br /&gt;
       if(args size == 0,&lt;br /&gt;
          &amp;quot;Hello world&amp;quot; println,&lt;br /&gt;
          args foreach(arg,&lt;br /&gt;
             writeln(&amp;quot;Hello &amp;quot;, doMessage(arg))&lt;br /&gt;
          )&lt;br /&gt;
       )&lt;br /&gt;
    )&lt;br /&gt;
==&amp;gt; method(setSlot(&amp;quot;args&amp;quot;, thisMessage arguments);&lt;br /&gt;
if(args size ==(0), &amp;quot;Hello world&amp;quot; println, args foreach(arg, writeln(&amp;quot;Hello &amp;quot;, d&lt;br /&gt;
oMessage(arg)))))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here the third argument becomes the &amp;quot;else&amp;quot; part of the conditional. An explicit return is no longer necessary since only one of the two messages can be evaluated.&lt;br /&gt;
&lt;br /&gt;
===Evaluating messages and a greater appreciation of &amp;quot;if&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
Let's implement our own &amp;quot;if&amp;quot; message.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; myIf := method(&lt;br /&gt;
       args := thisMessage arguments&lt;br /&gt;
       if(args size == 2,&lt;br /&gt;
          if(doMessage(args at(0)), doMessage(args at(1)))&lt;br /&gt;
       )&lt;br /&gt;
       if(args size == 3,&lt;br /&gt;
          if(doMessage(args at(0)),&lt;br /&gt;
             doMessage(args at(1)),&lt;br /&gt;
             doMessage(args at(2))&lt;br /&gt;
          )&lt;br /&gt;
       )&lt;br /&gt;
    )&lt;br /&gt;
==&amp;gt; method(setSlot(&amp;quot;args&amp;quot;, thisMessage arguments); if(args size ==(2), if(doMessage(args at(0)), doMessage(args at(1)))); if(args size ==(3), if(doMessage(args at(0)), doMessage(args at(1)), doMessage(args at(2)))))&lt;br /&gt;
Io&amp;gt; myIf(4 == 3, &amp;quot;foo&amp;quot; print, &amp;quot;bar&amp;quot; print)&lt;br /&gt;
bar&lt;br /&gt;
==&amp;gt; bar&lt;br /&gt;
Io&amp;gt; myIf(4 == 3, &amp;quot;foo&amp;quot; print, &amp;quot;bar&amp;quot; print; &amp;quot;baz&amp;quot; print)&lt;br /&gt;
barbaz&lt;br /&gt;
==&amp;gt; baz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It replicates &amp;quot;if&amp;quot; reasonably well, and it's quite simple. So how does this work?&lt;br /&gt;
&lt;br /&gt;
It wouldn't work in many other languages. They strictly evaluate expressions (the rough equivalent of &amp;quot;messages&amp;quot;). If something is passed as an argument to a method/function/etc. it is immediately evaluated, and any side-effects become immediately apparent.&lt;br /&gt;
&lt;br /&gt;
That is something we can't have with a conditional. It has to evaluate only one argument or the other. Fortunately Io makes this simple. Writing our own control structures is therefore a piece of cake.&lt;br /&gt;
&lt;br /&gt;
===More flexible conditionals===&lt;br /&gt;
&lt;br /&gt;
The conditionals we've seen so far are just peachy... if we want a very simple decision between two possibilities. It looks less nice when we have lots of possibilities.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
write(&amp;quot;Your name is? &amp;quot;)&lt;br /&gt;
name := File standardInput readLine&lt;br /&gt;
&lt;br /&gt;
if(name == &amp;quot;Clarence&amp;quot;) then(&lt;br /&gt;
   writeln(&amp;quot;What a goofy name.&amp;quot;)&lt;br /&gt;
) elseif(name == &amp;quot;Sid&amp;quot;) then(&lt;br /&gt;
   writeln(&amp;quot;Sure it is...&amp;quot;)&lt;br /&gt;
) else(&lt;br /&gt;
   writeln(&amp;quot;Hello &amp;quot;, name)&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will note that I didn't just copy and paste this from the interpreter. Instead, I save this in a file named &amp;quot;hello.io&amp;quot;, and run it from the command-line with &amp;quot;io hello.io&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can open your interpreter and send the following message.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
doFile(&amp;quot;hello.io&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will run the file. If you've created new methods in that file, they will become available later on in the interpreter.&lt;br /&gt;
&lt;br /&gt;
===Adding slots to something other than Object===&lt;br /&gt;
&lt;br /&gt;
So far all we've done is give new variables and methods to Object. We could try adding to something else.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; Number double := method(self * 2)&lt;br /&gt;
==&amp;gt; method(self *(2))&lt;br /&gt;
Io&amp;gt; 2 double&lt;br /&gt;
==&amp;gt; 4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
But how then did &amp;quot;Number&amp;quot; come into being?&lt;br /&gt;
&lt;br /&gt;
Number is just a clone of Object. It then had a bunch of extra stuff tacked on. But, that stuff was tacked onto Number, and not Object. For instance, + is valid for Number, but not for Object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; a := Object clone&lt;br /&gt;
==&amp;gt; Object_0074B3B0 do(&lt;br /&gt;
  appendProto(Object_003FD640)&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Io&amp;gt; a + 4&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Importer: Object does not respond to '+'&lt;br /&gt;
&lt;br /&gt;
Label                 Line       Char    Message&lt;br /&gt;
------------------------------------------------&lt;br /&gt;
VMCode                619        18724   raise(&amp;quot;Importer&amp;quot;, theObject type ..(&amp;quot; do)...&lt;br /&gt;
VMCode                623        18927   find(thisMessage name, self)&lt;br /&gt;
[command line]        1          3       +(4)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; Nil&lt;br /&gt;
Io&amp;gt; a := Number clone&lt;br /&gt;
==&amp;gt; 0&lt;br /&gt;
Io&amp;gt; a + 4&lt;br /&gt;
==&amp;gt; 4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And yet, Object is a prototype of Number, so Number responds to all of the messages Object does. Those already familiar with object-oriented programming should be thinking &amp;quot;inheritance&amp;quot; about now.&lt;br /&gt;
&lt;br /&gt;
But let's create something new.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; Name := Object clone&lt;br /&gt;
==&amp;gt; Object_00789D90 do(&lt;br /&gt;
  appendProto(Object_003FD640)&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Io&amp;gt; Name first := &amp;quot;&amp;quot;&lt;br /&gt;
==&amp;gt;&lt;br /&gt;
Io&amp;gt; Name last := &amp;quot;&amp;quot;&lt;br /&gt;
==&amp;gt;&lt;br /&gt;
Io&amp;gt; Name fullName := method(first with(&amp;quot; &amp;quot;) with(last))&lt;br /&gt;
==&amp;gt; method(first with(&amp;quot; &amp;quot;) with(last))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That looks messy. Let's use the &amp;quot;do&amp;quot; message to clean it up.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; Name := Object clone do(&lt;br /&gt;
       first := &amp;quot;&amp;quot;&lt;br /&gt;
       last := &amp;quot;&amp;quot;&lt;br /&gt;
       fullName := method(first with(&amp;quot; &amp;quot;) with(last))&lt;br /&gt;
    )&lt;br /&gt;
==&amp;gt; Object_0073A9C8 do(&lt;br /&gt;
  appendProto(Object_003FD640)&lt;br /&gt;
  first := &amp;quot;&amp;quot;&lt;br /&gt;
  last := &amp;quot;&amp;quot;&lt;br /&gt;
  fullName := Block_0078D3B8&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, we'll want to create new Name objects.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; myName := Name clone do(&lt;br /&gt;
       first := &amp;quot;Bob&amp;quot;&lt;br /&gt;
       last := &amp;quot;Smith&amp;quot;&lt;br /&gt;
    )&lt;br /&gt;
==&amp;gt; Object_00727DC8 do(&lt;br /&gt;
  appendProto(Object_0073A9C8)&lt;br /&gt;
  first := &amp;quot;Bob&amp;quot;&lt;br /&gt;
  last := &amp;quot;Smith&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Io&amp;gt; myName fullName&lt;br /&gt;
==&amp;gt; Bob Smith&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The myName object has as a prototype Name, and thus responds to the fullName message. Now, what if we want a more formal name?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; FormalName := Name clone do(&lt;br /&gt;
       title := &amp;quot;&amp;quot;&lt;br /&gt;
       fullName := method(&lt;br /&gt;
          name := resend&lt;br /&gt;
          title with(&amp;quot; &amp;quot;) with(name)&lt;br /&gt;
       )&lt;br /&gt;
    )&lt;br /&gt;
==&amp;gt; Object_00759DC0 do(&lt;br /&gt;
  appendProto(Object_0073A9C8)&lt;br /&gt;
  title := &amp;quot;&amp;quot;&lt;br /&gt;
  fullName := Block_0075A2A8&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Io&amp;gt; myName := FormalName clone do(&lt;br /&gt;
       first := &amp;quot;Bob&amp;quot;&lt;br /&gt;
       last := &amp;quot;Smith&amp;quot;&lt;br /&gt;
       title := &amp;quot;Mr.&amp;quot;&lt;br /&gt;
    )&lt;br /&gt;
==&amp;gt; Object_00767A88 do(&lt;br /&gt;
  appendProto(Object_00759DC0)&lt;br /&gt;
  title := &amp;quot;Mr.&amp;quot;&lt;br /&gt;
  first := &amp;quot;Bob&amp;quot;&lt;br /&gt;
  last := &amp;quot;Smith&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Io&amp;gt; myName fullName&lt;br /&gt;
==&amp;gt; Mr. Bob Smith&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since Name is a prototype of FormalName, we can use the resend message to send the fullName message to Name which gets the combination of the first and last names. We then simply add the title onto the beginning of that.&lt;br /&gt;
&lt;br /&gt;
===All sorts of prototype shenanigans===&lt;br /&gt;
&lt;br /&gt;
So, what if I have:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; myName := Name clone do(&lt;br /&gt;
       first := &amp;quot;Bob&amp;quot;&lt;br /&gt;
       last := &amp;quot;Smith&amp;quot;&lt;br /&gt;
    )&lt;br /&gt;
==&amp;gt; Object_00727DC8 do(&lt;br /&gt;
  appendProto(Object_0073A9C8)&lt;br /&gt;
  first := &amp;quot;Bob&amp;quot;&lt;br /&gt;
  last := &amp;quot;Smith&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Io&amp;gt; myName fullName&lt;br /&gt;
==&amp;gt; Bob Smith&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And I want to be able to treat this as a FormalName?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; myName do(&lt;br /&gt;
       title := &amp;quot;Mr.&amp;quot;&lt;br /&gt;
       prependProto(FormalName)&lt;br /&gt;
    )&lt;br /&gt;
==&amp;gt; Object_00742368 do(&lt;br /&gt;
  appendProto(Object_00746850, Object_007566B0)&lt;br /&gt;
  title := &amp;quot;Mr.&amp;quot;&lt;br /&gt;
  first := &amp;quot;Bob&amp;quot;&lt;br /&gt;
  last := &amp;quot;Smith&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Io&amp;gt; myName fullName&lt;br /&gt;
==&amp;gt; Mr. Bob Smith&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So, what exactly did I do?&lt;br /&gt;
&lt;br /&gt;
I added a title slot to myName, and I prepended FormalName onto the list of prototypes for myName.&lt;br /&gt;
&lt;br /&gt;
Then, when I sent the fullName message to myName, instead of looking in Name for fullName, it found a perfectly suitable version in FormalName and used that instead. I convinced myName that it is in fact a FormalName.&lt;br /&gt;
&lt;br /&gt;
===Operators===&lt;br /&gt;
&lt;br /&gt;
So, let's say we want to check to see if two names are equal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; Name setSlot(&amp;quot;==&amp;quot;,&lt;br /&gt;
       method(other,&lt;br /&gt;
          other first == first and other last == last&lt;br /&gt;
       )&lt;br /&gt;
    )&lt;br /&gt;
==&amp;gt; method(other, other first ==(first) and(other last ==(last)))&lt;br /&gt;
Io&amp;gt; a := Name clone do(first := &amp;quot;Bob&amp;quot;; last := &amp;quot;Smith&amp;quot;)&lt;br /&gt;
==&amp;gt; Object_00724490 do(&lt;br /&gt;
  appendProto(Object_007566B0)&lt;br /&gt;
  first := &amp;quot;Bob&amp;quot;&lt;br /&gt;
  last := &amp;quot;Smith&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Io&amp;gt; b := a clone&lt;br /&gt;
==&amp;gt; Object_00725BE8 do(&lt;br /&gt;
  appendProto(Object_00724490)&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Io&amp;gt; a == b&lt;br /&gt;
==&amp;gt; Bob&lt;br /&gt;
Io&amp;gt; b := a clone do(last := &amp;quot;Wilson&amp;quot;)&lt;br /&gt;
==&amp;gt; Object_00728DC0 do(&lt;br /&gt;
  appendProto(Object_00724490)&lt;br /&gt;
  last := &amp;quot;Wilson&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Io&amp;gt; a == b&lt;br /&gt;
==&amp;gt; Nil&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then defining the opposite is a simple matter of simply checking to see if they are not equal. If == returns Nil, then they are not equal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Io&amp;gt; Name setSlot(&amp;quot;!=&amp;quot;, method(other, (self == other) isNil))&lt;br /&gt;
==&amp;gt; method(other, (self ==(other)) isNil)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Originally created by [[Wtd]] at [http://www.compsci.ca/v2/viewtopic.php?t=10795 the forums], copied over by [[TheFerret]]''&lt;/div&gt;</summary>
		<author><name>TheFerret</name></author>	</entry>

	</feed>