I&#39;d rather see more fully fledged objects.<br><br>Andres.<br><br><div class="gmail_quote">On Tue, Mar 11, 2008 at 1:59 AM, Panu Logic &lt;<a href="mailto:panulogic@gmail.com">panulogic@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



  
  

<div bgcolor="#ffffff" text="#000000">
As an example of&nbsp; what I call &quot;A-SIGNATURES&quot;,&nbsp; let me propose (as an
example)&nbsp; <br>
that the following type-signatures should be part of the Smalltalk
Standard: <br>
<br>
<font face="Courier New">Message -&gt; #= &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
-&gt;&nbsp; Object&nbsp; &nbsp; -&gt;&nbsp; Object. <br>
Message -&gt; #argumentCount &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -&gt;&nbsp;
Integer. <br>
Message -&gt; #arguments &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; -&gt;&nbsp;
Collection. <br>
Message -&gt; #arguments: &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; -&gt;&nbsp; Object&nbsp;&nbsp;&nbsp; -&gt;&nbsp;
self. <br>
Message -&gt; #asSymbol &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; -&gt;&nbsp; Symbol.
<br>
Message -&gt; #forwardTo: &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; -&gt;&nbsp; Object&nbsp; &nbsp; -&gt;&nbsp;
Object. <br>
Message -&gt; #forwardTo:with: &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -&gt;&nbsp; Object&nbsp; &nbsp; -&gt;&nbsp;
Object&nbsp; &nbsp;&nbsp;&nbsp; -&gt;&nbsp; Object. <br>
Message -&gt; #forwardTo:withArguments:&nbsp;&nbsp;&nbsp; -&gt;&nbsp; Object&nbsp; &nbsp; -&gt;&nbsp;
Collection&nbsp; -&gt;&nbsp; Object. <br>
Message -&gt; #hash &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; -&gt;&nbsp; Integer. <br>
Message -&gt; #messages &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt;&nbsp; Collection. <br>
&nbsp;<br>
Message -&gt; #printOn: &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt;&nbsp; Stream&nbsp; &nbsp;&nbsp;&nbsp; -&gt;&nbsp;
self. <br>
Message -&gt; #selector &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; -&gt;&nbsp; Symbol. <br>
Message -&gt; #selector: &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -&gt;&nbsp; Symbol&nbsp; &nbsp;&nbsp;&nbsp; -&gt;&nbsp;
self. <br>
Message -&gt; #setSelector:arguments: &nbsp;&nbsp;&nbsp;&nbsp; -&gt;&nbsp; Object&nbsp; &nbsp;&nbsp;&nbsp; -&gt;&nbsp;
Object&nbsp; -&gt;&nbsp; Object. <br>
Message -&gt; #value: &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; -&gt;&nbsp; Object &nbsp;&nbsp;&nbsp;&nbsp; -&gt;&nbsp;
Object. <br>
Message -&gt; #value:value: &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; -&gt;&nbsp; Object&nbsp; &nbsp;&nbsp;&nbsp; -&gt;&nbsp;
Object&nbsp; -&gt;&nbsp; Object. <br>
Message -&gt; #valueWithArguments: &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -&gt;&nbsp; Collection&nbsp; -&gt;&nbsp;
Object. <br>
&nbsp;<br>
Message class -&gt; #selector: &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -&gt;&nbsp; Symbol&nbsp; &nbsp;&nbsp;&nbsp; -&gt;&nbsp;
self. <br>
Message class -&gt; #selector:argument: &nbsp;&nbsp; -&gt;&nbsp; Symbol&nbsp; &nbsp;&nbsp;&nbsp; -&gt;&nbsp;
Object&nbsp; &nbsp;&nbsp;&nbsp; -&gt;&nbsp; Object. <br>
Message class -&gt; #selector:arguments:&nbsp;&nbsp; -&gt;&nbsp; Symbol&nbsp; &nbsp;&nbsp;&nbsp; -&gt;&nbsp;
Collection&nbsp; -&gt;&nbsp; Object. </font><br>
<br>
<br>
The above should be interpreted as follows: <br>
<br>
1.&nbsp; The last element in each period-separated expression is the
result-type <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; of the method whose selector is the 3rd token within that
expression,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; and whose defining class is the&nbsp; result of evaluating the 1st
token of the expression.<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp; Thus, the above defines the method-signatures of&nbsp; the class
&quot;Message&quot;, and its meta-class.<br>
<br>
2.&nbsp; A result type written as &#39;self&#39; refers to the recipient type (which
would not be the same<br>
&nbsp;&nbsp;&nbsp;&nbsp; as the defining type in the context of signatures inherited to a&nbsp;
subclass) .<br>
<br>
3. Each of the above expressions results in an in-memory data-structure
which <br>
&nbsp;&nbsp; unambiguously express the signature&nbsp; of a single method.&nbsp; The
default implementation<br>
&nbsp;&nbsp; results in a set of connected Associations.<br>
<br>
4. Each class used within the expressions is part of the standard.<br>
<br>
<br>
NOTES: <br>
<ul>
  <li>Because each expression above&nbsp; is compiled by a standard
Smalltalk compiler, it becomes easy to detect any possible syntactic
errors in them. In other words, we have an easy way to <b><i>validate&nbsp;
    </i></b>specs like this .<br>
  </li>
  <ul>
    <li><br>
    </li>
  </ul>
  <li>Because each expression evaluates - with a standard Smalltalk
compiler - <br>
into an in-memory data-structure, it becomes easy to build tools that
use, compare or analyze this information.</li>
  <ul>
    <li><br>
    </li>
  </ul>
  <li>The in-memory data-structure contains references to actual
classes, not&nbsp; class-names. Therefore this -syntax does not care what if
any package-qualifier syntax might be adopted.&nbsp; (It also validates that
all referred-to classes exist).<br>
  </li>
  <ul>
    <li><br>
    </li>
  </ul>
  <li>If you have an alternative proposal for the type-signatures of
&quot;Message&quot;, you can easily modify the above spec, and we can compare our
alternatives with a text-diff tool, or perhaps by sorting them in
different ways in a spreadsheet program.</li>
  <ul>
    <li><br>
    </li>
  </ul>
  <li>The expressions are quite succinct, yet readable.</li>
  <ul>
    <li>&nbsp;</li>
  </ul>
  <li>As an implementation detail, the method<b> #-&gt; </b>could be
redefined for Behavior so that as a side-effect it also compiles and
remembers a list of every signature associated with that class.<br>
  </li>
</ul>
<br>
<br>
<br>
</div>



<br>_______________________________________________<br>
ANSI-Smalltalk mailing list<br>
<a href="mailto:ANSI-Smalltalk@lists.openskills.org">ANSI-Smalltalk@lists.openskills.org</a><br>
<a href="http://lists.openskills.org/cgi-bin/mailman/listinfo/ansi-smalltalk" target="_blank">http://lists.openskills.org/cgi-bin/mailman/listinfo/ansi-smalltalk</a><br>
<br></blockquote></div><br>