On Mar 11, 2009, at 14:38, Jonathan S. Shapiro wrote:

> I was initially concerned that keyword arguments would require
> overhauling the type checker, but I now see that this is not true;
> it's simply that definitions and declarations must agree.


This may or may not be a useful point, but Smalltalk-style labeled  
arguments have the property of being purely a syntactic feature, with  
no impact on the runtime semantics of the language.

They also effectively allow overloading over the set of argument-names  
present; this allows optional parameters (default values) to be  
implemented without any language support (so no impact on type  
inference etc.).

(Please note that all this could be applied to "functions" as well as  
"objects"; just consider the text to be not a verb/selector/method- 
name but part of the parameter/argument list's "type" signature.)

The two-argument call in Smalltalk syntax

   a flibble: b withBar: c

has these components:

   Receiver: a
   Selector: "flibble:withBar:"
   Arguments: (b, c)

And the same technique could just as well be applied to named-argument- 
style syntax; the arguments could even be sorted so as to come up with  
a canonical signature. That is,

   f(foo: b, bar: c)

meaning

   Function: f
   Argument-names: ("bar", "foo")
   Arguments: (b, c)

-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>


_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to