<div dir="ltr">Thats brilliant, <div><br></div><div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">lobby _AddSlotsIfAbsent: ( | person = ( | name. age. test = ( 'test' </span><span style="font-family:arial,sans-serif;font-size:13px">printLine ) | ) | )</span><br>
</div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">In english, </span></div><div><font face="arial, sans-serif">I am sending the lobby object a message to add a new slot called person, and in that slot put an object '</font><span style="font-family:arial,sans-serif;font-size:13px">( | name. age. test = ( 'test' </span><span style="font-size:13px;font-family:arial,sans-serif">printLine ) | )</span><span style="font-size:13px;font-family:arial,sans-serif"> </span><font face="arial, sans-serif">' which consists of three different slots; name, age and test. the test slot contains a method that prints 'test'.</font></div>
<div><span style="font-size:13px;font-family:arial,sans-serif"></span><font face="arial, sans-serif"><br></font></div><div><font face="arial, sans-serif">I tried the following in the terminal and in the shell</font></div>
<div><p style="margin:0px;font-size:11px;font-family:Menlo"><br></p><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
"Self 1" <br>"Self 1" lobby _AddSlotsIfAbsent: ( | person3 = ( | parent* = traits clonable . name . age | 'test' printLine ) | )<br>lobby<br>"Self 1"</blockquote>
<p style="margin:0px;font-size:11px;font-family:Menlo"><br></p><p style="margin:0px;font-size:11px;font-family:Menlo">I'm trying to make a method object and it seems to succeed,am I right about the following; </p><p style="margin:0px;font-size:11px;font-family:Menlo">
1. defining a method object doesn't seem to run it's code? (I don't get 'test' returned). Instead if I do 'lobby person5'. </p><p style="margin:0px;font-size:11px;font-family:Menlo"> - Am I right that method objects only 'run' when called, and their slots only exist for the duration of their action?</p>
<p style="margin:0px;font-size:11px;font-family:Menlo">2. method objects don't get an outliner - because they only exist as objects while they are running.</p><p style="margin:0px;font-size:11px;font-family:Menlo"><br>
</p><p style="margin:0px;font-size:11px;font-family:Menlo">This seems to indicate I can't create an object that can do some setup code when it is created? Am I missing a trick?</p><p style="margin:0px;font-size:11px;font-family:Menlo">
<br></p><p style="margin:0px;font-size:11px;font-family:Menlo">Thanks for your help.</p><p style="margin:0px;font-size:11px;font-family:Menlo"><br></p><p style="margin:0px;font-size:11px;font-family:Menlo">Stephen</p><p style="margin:0px;font-size:11px;font-family:Menlo">
<br></p><p style="margin:0px;font-size:11px;font-family:Menlo"><br></p></div></div><div class="gmail_extra"><br clear="all"><div><br>--<br>Stephen De Gabrielle<br><a href="mailto:stephen.degabrielle@acm.org" target="_blank">stephen.degabrielle@acm.org</a><br>
Telephone +44 (0)20 85670911<br>Mobile +44 (0)79 85189045<br><a href="http://www.degabrielle.name/stephen" target="_blank">http://www.degabrielle.name/stephen</a><br></div>
<br><br><div class="gmail_quote">On Fri, Mar 14, 2014 at 12:02 AM, Jecel Assumpcao Jr. <span dir="ltr"><<a href="mailto:jecel@merlintec.com" target="_blank">jecel@merlintec.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>
<div style>
<span> </span>
<div>
<div>
<div>
<p>Stephen,</p><div class=""><br>
<br>
> I've had some success creating objects from Morphic and using the<br>
> outliner, but I can't seem to create objects using the shell. <br>
> I have tried typing in some of the early examples in the handbook,<br>
> but I only get errors.<br>
> <br>
> Person = (|name. age | 'test' printLn )<br>
> <br>
> Example from handbook<br>
> <br>
> <br></div>
> ( | slot1. slot2 | ?here is some code? printLine )<br>
<br>
That is an example of a method, not a normal object. A normal object<br>
would look like:<br>
<br>
( | slot1. slot2 | )<br>
<br>
The second problem is that you are defining a slot at the prompt, but<br>
slots can only be defined inside some object. Before we had a GUI (Self<br>
4) we did stuff like:<br>
<br>
lobby _AddSlotsIfAbsent: ( | person = ( | name. age. test = ( 'test'<br>
printLn ) | ) | )<br>
<br>
If that works, you can then try this at the prompt:<br>
<br>
person test<br>
<br>
This example has at least two problems even if it works: the new person<br>
object doesn't have any traits, like clonable or oddball and its data<br>
slots don't have any interesting values, only nil.<br>
<br>
-- Jecel<br>
<br>
<p></p>
</div>
<div style="color:#fff;min-height:0"></div>
</div>
</blockquote></div><br></div>