On 2010-09-20 16:19, Michel Fortin wrote:
What about two methods that take the same number of parameters and of
the same types but have two distinct selectors in Objective-C, like
insertSublayer:below: and insertSublayer:above: in the CALayer class
in the QuartzCore framework. Should those be translated to
insertSublayerBelow or insertSublayer_below_ or something like that?
Or have you planed a syntax that will solve this some other way?
There is no automatic conversion from a selector to a D method name: you
specify the method name (as usual) and you specify the selector (if you
care about the selector, like in bindings). If you have a script that
automatically creates bindings, then that script is the one that must
figure out what method name to use for what selector.
Because of this, there is no need for the D method name to be related to
the selector. When you call a method, the method name is used to find
the method declaration; and the declaration contains the selector to
use. Calling undeclared methods is unsupported (unlike in Objective-C).
Makes sense.
--
/Jacob Carlborg