<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Yea and no. I have extended the parser so that methods (including
traits) can access dynamic variables. The current version accepts code
like:<br>
&nbsp;&nbsp;&nbsp;<font face="Courier New, Courier, monospace"> <b>play1</b><br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Roles: #(Arrow12)&gt;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self displayLarge: '1'.<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Arrow12 play12.</font><br>
where <font face="Courier New, Courier, monospace"><i>Arrow12 </i></font>is
a dynamic variable. It can be seen as an alias for an object,. The
binding occurs at run time by a dictionary lookup; the dictionary is
called a <i>context </i>and lives on the stack. The role traits are
always executed in such a context. The roles appear at run time as
context keys. This means that the same object can play several roles at
the same time by simply being bound to several keys. Conversely, the
same role can simultaneously&nbsp; be played by different objects since
there can be several contexts on the stack at the same time.<br>
<br>
Many programmers find it hard to think in terms of classes AND objects
at the same time. I try to build an IDE that makes the bridge from
class to object as short and intuitively simple as possible. (I also
have to hide the fact that the context lives on the stack).<br>
<br>
Cheers<br>
--Trygve<br>
<br>
<br>
On 16.05.2008 16:07, itsme213 wrote:
<blockquote cite="mid:g0k4f2$k70$1@ger.gmane.org" type="cite">
  <pre wrap="">"Trygve Reenskaug" <a class="moz-txt-link-rfc2396E" href="mailto:trygver@ifi.uio.no">&lt;trygver@ifi.uio.no&gt;</a> wrote in message

  </pre>
  <blockquote type="cite">
    <pre wrap="">It was a major breakthrough when I realized that a role should be coded
as a trait, the trait defining what the object does in the context of a
structure of collaborating, role playing objects.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
This mapping of role to trait is quite intuitively appealing.

However, since
- traits are applied statically, not dynamically
and
- trait callbacks to the object (required methods) are hardcoded in the 
trait definition itself with no way to rename (only alias)

Wouldn't it be quite difficult to handle the more general cases of dynamic 
roles, and of multiple roles of the same role type (e.g. I am a programmer 
on projects p1 and p2)?

In these casees would you revert to using separate role-objects? e.g. a 
Person class with a iVar that is a collection of role-like objects, one for 
"programmer-on-p1" and one for "programmer-on-p2"?

Curious - Sophie 





  </pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<meta http-equiv="Content-Type" content="text/html; ">
<meta name="ProgId" content="Word.Document">
<meta name="Generator" content="Microsoft Word 10">
<meta name="Originator" content="Microsoft Word 10">
<link rel="File-List" href="TrygveSignature-filer/filelist.xml">
<title>-- </title>
<!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:HyphenationZone>21</w:HyphenationZone>
  <w:PunctuationKerning/>
  <w:DrawingGridHorizontalSpacing>6 pt</w:DrawingGridHorizontalSpacing>
  <w:DrawingGridVerticalSpacing>6 pt</w:DrawingGridVerticalSpacing>
  <w:DisplayHorizontalDrawingGridEvery>0</w:DisplayHorizontalDrawingGridEvery>
  <w:DisplayVerticalDrawingGridEvery>3</w:DisplayVerticalDrawingGridEvery>
  <w:UseMarginsForDrawingGridOrigin/>
  <w:DoNotShadeFormData/>
  <w:Compatibility>
   <w:FootnoteLayoutLikeWW8/>
   <w:ShapeLayoutLikeWW8/>
   <w:AlignTablesRowByRow/>
   <w:ForgetLastTabAlignment/>
   <w:LayoutRawTableWidth/>
   <w:LayoutTableRowsApart/>
   <w:UseWord97LineBreakingRules/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {mso-style-parent:"";
        margin:0cm;
        margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:12.0pt;
        font-family:"Times New Roman";
        mso-fareast-font-family:"Times New Roman";}
span.SpellE
        {mso-style-name:"";
        mso-spl-e:yes;}
span.GramE
        {mso-style-name:"";
        mso-gram-e:yes;}
 /* Page Definitions */
 @page
        {mso-page-border-surround-header:no;
        mso-page-border-surround-footer:no;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;
        mso-header-margin:35.4pt;
        mso-footer-margin:35.4pt;
        mso-paper-source:0;}
div.Section1
        {page:Section1;}
-->
</style><!--[if gte mso 10]>
<style>
 /* Style Definitions */
 table.MsoNormalTable
        {mso-style-name:"Vanlig tabell";
        mso-tstyle-rowband-size:0;
        mso-tstyle-colband-size:0;
        mso-style-noshow:yes;
        mso-style-parent:"";
        mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
        mso-para-margin:0cm;
        mso-para-margin-bottom:.0001pt;
        mso-pagination:widow-orphan;
        font-size:10.0pt;
        font-family:"Times New Roman";}
</style>
<![endif]--><!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="2050"/>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1"/>
 </o:shapelayout></xml><![endif]-->
<div class="Section1">
<p class="MsoNormal" style=""><span class="SpellE"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Trygve</span></span><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">
Reenskaug<span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>mailto: <span class="SpellE"><a class="moz-txt-link-abbreviated" href="mailto:trygver@ifi.uio.no">trygver@ifi.uio.no</a></span></span><span
 style="font-size: 10pt; font-family: Arial;"><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span class="SpellE"><span class="GramE"><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB">Morgedalsvn</span></span></span><span
 class="GramE"><span style="font-size: 10pt; font-family: Arial;"
 lang="EN-GB">.</span></span><span
 style="font-size: 10pt; font-family: Arial;" lang="EN-GB"> 5A <span
 style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><a class="moz-txt-link-freetext" href="http://heim.ifi.uio.no/~trygver">http://heim.ifi.uio.no/~trygver</a><o:p></o:p></span></p>
<p class="MsoNormal" style=""><span
 style="font-size: 10pt; font-family: Arial;">N-0378
Oslo<span style="">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>Tel: (+47) 22 49 57 27<o:p></o:p></span></p>
<p class="MsoNormal" style=""><span class="SpellE"><span
 style="font-size: 10pt; font-family: Arial;">Norway</span></span><span
 style="font-size: 10pt; font-family: Arial;"><o:p></o:p></span></p>
</div>
</div>
</body>
</html>