I'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 <<a href="mailto:panulogic@gmail.com">panulogic@gmail.com</a>> 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 what I call "A-SIGNATURES", let me propose (as an
example) <br>
that the following type-signatures should be part of the Smalltalk
Standard: <br>
<br>
<font face="Courier New">Message -> #=
-> Object -> Object. <br>
Message -> #argumentCount ->
Integer. <br>
Message -> #arguments ->
Collection. <br>
Message -> #arguments: -> Object ->
self. <br>
Message -> #asSymbol -> Symbol.
<br>
Message -> #forwardTo: -> Object ->
Object. <br>
Message -> #forwardTo:with: -> Object ->
Object -> Object. <br>
Message -> #forwardTo:withArguments: -> Object ->
Collection -> Object. <br>
Message -> #hash -> Integer. <br>
Message -> #messages -> Collection. <br>
<br>
Message -> #printOn: -> Stream ->
self. <br>
Message -> #selector -> Symbol. <br>
Message -> #selector: -> Symbol ->
self. <br>
Message -> #setSelector:arguments: -> Object ->
Object -> Object. <br>
Message -> #value: -> Object ->
Object. <br>
Message -> #value:value: -> Object ->
Object -> Object. <br>
Message -> #valueWithArguments: -> Collection ->
Object. <br>
<br>
Message class -> #selector: -> Symbol ->
self. <br>
Message class -> #selector:argument: -> Symbol ->
Object -> Object. <br>
Message class -> #selector:arguments: -> Symbol ->
Collection -> Object. </font><br>
<br>
<br>
The above should be interpreted as follows: <br>
<br>
1. The last element in each period-separated expression is the
result-type <br>
of the method whose selector is the 3rd token within that
expression,<br>
and whose defining class is the result of evaluating the 1st
token of the expression.<br>
<br>
Thus, the above defines the method-signatures of the class
"Message", and its meta-class.<br>
<br>
2. A result type written as 'self' refers to the recipient type (which
would not be the same<br>
as the defining type in the context of signatures inherited to a
subclass) .<br>
<br>
3. Each of the above expressions results in an in-memory data-structure
which <br>
unambiguously express the signature of a single method. The
default implementation<br>
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 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
</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 class-names. Therefore this -syntax does not care what if
any package-qualifier syntax might be adopted. (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
"Message", 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> </li>
</ul>
<li>As an implementation detail, the method<b> #-> </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>