extern(C++, ns)

Manu via Digitalmars-d digitalmars-d at puremagic.com
Wed Jan 20 04:17:56 PST 2016


On 20 January 2016 at 18:38, Walter Bright via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On 1/19/2016 11:51 PM, Manu via Digitalmars-d wrote:
>>
>> You admit
>
>
> This is where a debate about ideas leaves the rails. This is not a court,
> nobody has alleged a crime. I want to bring it back on the track.
>
> I want to help you be successful with interfacing D with C++. You have
> posted several bugs with the ns implementation. I have fixed those bugs, and
> you agreed they were fixed.
>
> You wrote there are remaining serious problems with ns. I have no idea what
> they are. Please post code that illustrates what serious problem(s) you are
> having.

I'm blocked by the interface inheritance. I can work-around anything
other than that, but there's no way I can progress without being able
to call methods.


This set of related problems, all have bitten me.

-- name.x.d--------------------
module name.x;
-- name.y.d--------------------
module name.y;
import name.x;
extern(C++, name) int x;
------------------------------------

------------------------------------
extern(C++, delegate) int x;
------------------------------------


You claim this is a problem that must desperately be solved:
------------------------------------
int x;
extern(C++, ns) int x;
------------------------------------

The solution arrives at basically the same problem:
------------------------------------
int ns;
extern(C++, ns) int x;
------------------------------------

We've just robbed peter to pay paul?



Finally, the one that really upsets me, is that scanning reflection
needs to be retrofit with new tricks to recurse into namespaces:
------------------------------------
extern(C++, ns) void f();
pragma(msg, __traits(allMembers, mixin(__MODULE__)));
------------------------------------
> tuple("object", "ns")

... f() is not present.

By extension of this, extern(C++, ns) declarations are incompatible
with every single implementation of scanning reflection I've written
in the past 6 years, and everyone else's too.
All such code needs to be retrofit with new tricks to recurse into ns.

On 20 January 2016 at 18:38, Walter Bright via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On 1/19/2016 11:51 PM, Manu via Digitalmars-d wrote:
>>
>> You admit
>
>
> This is where a debate about ideas leaves the rails. This is not a court,
> nobody has alleged a crime. I want to bring it back on the track.
>
> I want to help you be successful with interfacing D with C++. You have
> posted several bugs with the ns implementation. I have fixed those bugs, and
> you agreed they were fixed.
>
> You wrote there are remaining serious problems with ns. I have no idea what
> they are. Please post code that illustrates what serious problem(s) you are
> having.
>


More information about the Digitalmars-d mailing list