Thanks. Much appreciated.<span></span><br><br>On Saturday, 15 March 2014, ardeujho <<a href="mailto:ardeujho@cd.pn">ardeujho@cd.pn</a>> 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><u></u>


</p><div> </div>
<div> </div>
<div> </div>
<div>On Sat, Mar 15, 2014, at 05:36 AM, Stephen De Gabrielle wrote:<span></span><br></div>
<blockquote style="margin:0px 0px 0px 4px" type="cite"><div style="font-family:Arial,helvetica,clean,sans-serif;font-size:13px"><div><div style="font-family:Georgia"><div dir="ltr"><div><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'. <br></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?<br>
</p></div>
</div>
</div>
</div>
</div>
</blockquote><div style="font-family:Arial,helvetica,clean,sans-serif;font-size:13px"><div><div style="font-family:Georgia"><div dir="ltr"><div><div> </div>
<div>Yes, that's right. Your method, person3, is created and added as a slot. It is called when you do "lobby person3". That method has local variables age, name and parent.<br></div>
<div> </div>
</div>
</div>
</div>
</div>
</div>
<blockquote style="margin:0px 0px 0px 4px" type="cite"><div style="font-family:Arial,helvetica,clean,sans-serif;font-size:13px"><div><div style="font-family:Georgia"><div dir="ltr"><div><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.<br></p></div>
</div>
</div>
</div>
</div>
</blockquote><div style="font-family:Arial,helvetica,clean,sans-serif;font-size:13px"><div><div style="font-family:Georgia"><div dir="ltr"><div><div>Right. You can get an object representing the method using mirrors:<br>
</div>
<div> </div>
<div>  (reflect: lobby') at: 'person3'<br></div>
<div> </div>
<div>Browse through the methods on that in an outliner.<br></div>
<div> </div>
</div>
</div>
</div>
</div>
</div>
<blockquote style="margin:0px 0px 0px 4px" type="cite"><div style="font-family:Arial,helvetica,clean,sans-serif;font-size:13px"><div><div style="font-family:Georgia"><div dir="ltr"><div><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?<br></p></div>
</div>
</div>
</div>
</div>
</blockquote><div style="font-family:Arial,helvetica,clean,sans-serif;font-size:13px"><div><div style="font-family:Georgia"><div dir="ltr"><div><div> </div>
<div>This is often done with a variant of 'copy'. Eg. on an object you'd do:<br></div>
<div> </div>
<div>  myobject copyWithSomeEffect: 'blah'.<br></div>
<div> </div>
<div> </div>
</div>
</div>
</div>
</div>
</div>
<blockquote style="margin:0px 0px 0px 4px" type="cite"><div style="color:#fff;min-height:0"> </div>
</blockquote>

<p></p>

    </div>
     

    
    <div style="color:#fff;min-height:0"></div>


</div>



  






</blockquote><br><br>-- <br>Sent from Gmail Mobile<br>