D/Objective-C: hit a dead end, start anew
Michel Fortin
michel.fortin at michelf.com
Mon Sep 20 07:19:37 PDT 2010
On 2010-09-20 04:23:38 -0400, Jacob Carlborg <doob at me.com> said:
> On 2010-09-18 16:36, Michel Fortin wrote:
>> Though I might decide on something else later. I'm thinking about
>> mangling the argument types in the selector to make it work better with
>> overloading.
>
> 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).
--
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/
More information about the Digitalmars-d-announce
mailing list