DIP87: Enhanced Foreign-Language Binding

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 22 08:37:31 PST 2016


On 2016-01-21 05:21, Anon wrote:
> Seeing the recent extern(C++) threads, and much concern therein, I'd
> like to propose DIP87: http://wiki.dlang.org/DIP87
>
> Destroy to your heart's content.

* How do you plan to differentiate specifying the namespace compared 
with specifying the mangled name for an extern(C++) symbol?

* For Objective-C bindings one needs to be able to specify the mangled 
name for a class or interface without affecting the names of the 
methods. It's required because in Objective-C it's possible to have the 
same name for a class and a protocol (interface). In the Foundation 
framework (standard library) there are a class "Object" and a protocol 
"Object"

* When creating Objective-C bindings it's basically required to specify 
the selector for every method

* In Objective-C the mangled name and the selector is not the same. The 
mangled name is for the linker to find the correct symbol. The selector 
is for finding the correct method implementation at runtime

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list