Pretty please: Named arguments

Jonathan M Davis jmdavisProg at gmx.com
Mon Feb 28 00:04:31 PST 2011


On Sunday 27 February 2011 23:40:41 Bekenn wrote:
> On 2/27/2011 11:32 PM, Russel Winder wrote:
> > The Python mechanism relies on the fact that despatch is by name and not
> > by signature.  Languages that dispatch by signature will have
> > significantly greater problems!
> 
> I don't follow; the compiler has to look up the correct function
> signature whether you use named arguments or not.  How is this
> significantly different?

You could be linking to code where you don't _have_ the source and don't _have_ 
the names of the variables. It's all done by the function signature in C, C++, 
Java, C#, D, etc. The names of the variables are completely irrelevant to 
calling the function, and so any linkers that follow C conventions (as with 
happens with D) _must_ be able to deal with function calls based on their 
signatures. That doesn't necessarily mean that it would be _impossible_ to find a 
way to have named arguments in D, but it makes it _far_ harder.

- Jonathna M Davis


More information about the Digitalmars-d mailing list