A Way to express Standard multi-argument Method Signatures in Smalltalk Re: [ANSI-Smalltalk] Next STEPs

Panu Logic panulogic at gmail.com
Sat Mar 8 23:57:17 GMT 2008


In my previous post I proposed  a way to express the signature
of a Smalltalk method as an evaluable Smalltalk expression
which evaluates to a set of connected Associations which formally
express the type-signature of any Smalltalk method, in the form of:
>  receiverClass  ->  selectorSymbol  -> argumentClass ->   resultClass


A question that will  immediately arise is, "What about multiple keyword 
arguments?".

The answer to my mind  is simple: The last leaf in the graph of 
Associations
is the declaration of the  result-type.

So you could express the signature of a multi-keyword-arguments method as:

   receiverClass  ->  selectorSymbol  -> argClass1 -> argClass2  ....    
->   resultClass


This will still result in an instance of an Association (connected to 
other Associations),
that would formally express the class of the method, the name of the 
method,
its argument-types. and its result-type.  The point is simply that the 
result-type is
the "last leaf in the chain".



Thanks
-Panu Viljamaa






More information about the ANSI-Smalltalk mailing list