Jump to page: 1 26  
Page
Thread overview
extern(C++, ns) is wrong
Sep 04, 2018
Manu
Sep 04, 2018
Neia Neutuladh
Sep 04, 2018
Manu
Sep 04, 2018
Walter Bright
Sep 05, 2018
tide
Sep 05, 2018
Manu
Sep 05, 2018
tide
Sep 05, 2018
Manu
Sep 05, 2018
Joakim
Sep 05, 2018
Manu
Oct 10, 2018
evilrat
Sep 05, 2018
Manu
Sep 05, 2018
Walter Bright
Sep 05, 2018
bauss
Sep 05, 2018
Manu
Sep 05, 2018
Walter Bright
Sep 05, 2018
Jonathan M Davis
Sep 05, 2018
rikki cattermole
Sep 05, 2018
Nicholas Wilson
Sep 05, 2018
Jonathan M Davis
Sep 06, 2018
Nicholas Wilson
Sep 10, 2018
Carl Sturtivant
Sep 11, 2018
Manu
Sep 12, 2018
Danni Coy
Sep 12, 2018
Nicholas Wilson
Sep 12, 2018
Manu
Sep 13, 2018
Danni Coy
Sep 05, 2018
Manu
Sep 05, 2018
Paolo Invernizzi
Sep 05, 2018
bauss
Sep 05, 2018
Walter Bright
Sep 12, 2018
Jonathan M Davis
Sep 12, 2018
Jonathan M Davis
Sep 13, 2018
Jonathan M Davis
Sep 13, 2018
Danni Coy
Sep 13, 2018
Jonathan M Davis
Sep 13, 2018
Manu
Sep 13, 2018
Manu
Sep 13, 2018
Jonathan M Davis
Sep 14, 2018
Zot
Sep 14, 2018
Atila Neves
Sep 14, 2018
12345swordy
Sep 14, 2018
Manu
Sep 14, 2018
Jonathan M Davis
Sep 14, 2018
Danni Coy
Sep 15, 2018
Danni Coy
Sep 15, 2018
Neia Neutuladh
Sep 17, 2018
Atila Neves
Sep 19, 2018
Manu
Sep 19, 2018
Walter Bright
Sep 19, 2018
Manu
Sep 19, 2018
Jonathan M Davis
Sep 19, 2018
rikki cattermole
Sep 19, 2018
Jonathan M Davis
September 04, 2018
file1.d
---------
module bliz.ecs.component_access;
import bliz.ecs.table;
import bliz.ecs.types;
extern(C++, bliz):
// things...

Error: project\ecs\include\d2\bliz\ecs\component_access.d(7): Error: namespace `bliz.ecs.component_access.bliz` conflicts with import `bliz.ecs.component_access.bliz` at project\ecs\include\d2\bliz\ecs\component_access.d(3)

file2.d
---------
module bliz.ecs.table;
import bliz.ecs.types;
extern(C++, bliz):
// things...

Error: project\ecs\include\d2\bliz\ecs\table.d(11): Error: namespace
`bliz.ecs.table.bliz` conflicts with import `bliz.ecs.table.bliz` at
project\ecs\include\d2\bliz\ecs\table.d(5)


Oh yeah, I forgot, root namespace in D can not be the same as the C++ namespace... common sense would dictate that they be the same thing, but that's the exact thing that they can not be.


Walter: This is not sustainable!
Please add no-scope string namespace.
I have no option left available besides literally begging you. Please
put an end to this madness. It can live peacefully beside your
preferred design with the scopes. We can both have our cake.

The design is a critical failure; everything you write leads to problems in the simplest forms. It's a constant ongoing hurdle, and I have to contort my code to undo a thing that should never have been there. It's truly embarrassing. I can't show this to people.

***I can not present my work to stakeholders with a straight face***

I don't know what to do other than fork the compiler and add it locally, and then we'd be stuck on a dialect, and that would be truly terrible!

Andrei, please convince Walter to fix this... please.
I beg you both. Just fix it...
There was community consensus in the last uber-thread on the matter.
September 04, 2018
On Tuesday, 4 September 2018 at 22:33:34 UTC, Manu wrote:
> Error: project\ecs\include\d2\bliz\ecs\component_access.d(7): Error: namespace `bliz.ecs.component_access.bliz` conflicts with import `bliz.ecs.component_access.bliz` at project\ecs\include\d2\bliz\ecs\component_access.d(3)

The obvious workaround is to wrap the entire C++ library in one file, right? Nothing could possibly be suboptimal about that. Just shove four thousand class definitions in there, it'll be fine.
September 04, 2018
On Tue, 4 Sep 2018 at 16:00, Neia Neutuladh via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>
> On Tuesday, 4 September 2018 at 22:33:34 UTC, Manu wrote:
> > Error: project\ecs\include\d2\bliz\ecs\component_access.d(7): Error: namespace `bliz.ecs.component_access.bliz` conflicts with import `bliz.ecs.component_access.bliz` at project\ecs\include\d2\bliz\ecs\component_access.d(3)
>
> The obvious workaround is to wrap the entire C++ library in one file, right? Nothing could possibly be suboptimal about that. Just shove four thousand class definitions in there, it'll be fine.

Even that still wouldn't solve this problem where the root namespace
can't be the same as the C++ namespace... which is the common-sense
choice for the root namespace >_<
I need to think up pointlessly different names for all the C++ package
names to call the packages in D.
September 04, 2018
On 9/4/2018 3:33 PM, Manu wrote:
> file1.d
> ---------
> module bliz.ecs.component_access;
> import bliz.ecs.table;
> import bliz.ecs.types;
> extern(C++, bliz):
> // things...
> 
> Error: project\ecs\include\d2\bliz\ecs\component_access.d(7): Error:
> namespace `bliz.ecs.component_access.bliz` conflicts with import
> `bliz.ecs.component_access.bliz` at
> project\ecs\include\d2\bliz\ecs\component_access.d(3)
> 
> file2.d
> ---------
> module bliz.ecs.table;
> import bliz.ecs.types;
> extern(C++, bliz):
> // things...
> 
> Error: project\ecs\include\d2\bliz\ecs\table.d(11): Error: namespace
> `bliz.ecs.table.bliz` conflicts with import `bliz.ecs.table.bliz` at
> project\ecs\include\d2\bliz\ecs\table.d(5)

I can't help because the examples are incomplete. There is no line 5 in table.d, nor a line 7 in component_access.d The error messages are not generated from the code posted.
September 05, 2018
On Tuesday, 4 September 2018 at 23:32:31 UTC, Walter Bright wrote:
> On 9/4/2018 3:33 PM, Manu wrote:
>> file1.d
>> ---------
>> module bliz.ecs.component_access;
>> import bliz.ecs.table;
>> import bliz.ecs.types;
>> extern(C++, bliz):
>> // things...
>> 
>> Error: project\ecs\include\d2\bliz\ecs\component_access.d(7): Error:
>> namespace `bliz.ecs.component_access.bliz` conflicts with import
>> `bliz.ecs.component_access.bliz` at
>> project\ecs\include\d2\bliz\ecs\component_access.d(3)
>> 
>> file2.d
>> ---------
>> module bliz.ecs.table;
>> import bliz.ecs.types;
>> extern(C++, bliz):
>> // things...
>> 
>> Error: project\ecs\include\d2\bliz\ecs\table.d(11): Error: namespace
>> `bliz.ecs.table.bliz` conflicts with import `bliz.ecs.table.bliz` at
>> project\ecs\include\d2\bliz\ecs\table.d(5)
>
> I can't help because the examples are incomplete. There is no line 5 in table.d, nor a line 7 in component_access.d The error messages are not generated from the code posted.

That's all you need really, any symbol you add will cause the error.

extern(C++, bliz):

created a symbol "bliz", you can't import a package from "bliz" cause then there's a symbol clash. I thought you implemented extern(C++) ...
September 04, 2018
On Tue, 4 Sep 2018 at 16:35, Walter Bright via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>
> On 9/4/2018 3:33 PM, Manu wrote:
> > file1.d
> > ---------
> > module bliz.ecs.component_access;
> > import bliz.ecs.table;
> > import bliz.ecs.types;
> > extern(C++, bliz):
> > // things...
> >
> > Error: project\ecs\include\d2\bliz\ecs\component_access.d(7): Error: namespace `bliz.ecs.component_access.bliz` conflicts with import `bliz.ecs.component_access.bliz` at project\ecs\include\d2\bliz\ecs\component_access.d(3)
> >
> > file2.d
> > ---------
> > module bliz.ecs.table;
> > import bliz.ecs.types;
> > extern(C++, bliz):
> > // things...
> >
> > Error: project\ecs\include\d2\bliz\ecs\table.d(11): Error: namespace
> > `bliz.ecs.table.bliz` conflicts with import `bliz.ecs.table.bliz` at
> > project\ecs\include\d2\bliz\ecs\table.d(5)
>
> I can't help because the examples are incomplete. There is no line 5 in table.d, nor a line 7 in component_access.d The error messages are not generated from the code posted.

I'm not asking for help. I know painfully well all the workarounds required to make this stuff work.

I'm just showing one case that you tend to be confronted with immediately, which is that if you import a module, and then open a namespace with the same name as the root namespace of a module you imported, that is an error condition; the namespace conflicts with the root namespace of the import.
September 04, 2018
On Tue, 4 Sep 2018 at 17:30, tide via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>
> On Tuesday, 4 September 2018 at 23:32:31 UTC, Walter Bright wrote:
> > On 9/4/2018 3:33 PM, Manu wrote:
> >> file1.d
> >> ---------
> >> module bliz.ecs.component_access;
> >> import bliz.ecs.table;
> >> import bliz.ecs.types;
> >> extern(C++, bliz):
> >> // things...
> >>
> >> Error: project\ecs\include\d2\bliz\ecs\component_access.d(7):
> >> Error:
> >> namespace `bliz.ecs.component_access.bliz` conflicts with
> >> import
> >> `bliz.ecs.component_access.bliz` at
> >> project\ecs\include\d2\bliz\ecs\component_access.d(3)
> >>
> >> file2.d
> >> ---------
> >> module bliz.ecs.table;
> >> import bliz.ecs.types;
> >> extern(C++, bliz):
> >> // things...
> >>
> >> Error: project\ecs\include\d2\bliz\ecs\table.d(11): Error:
> >> namespace
> >> `bliz.ecs.table.bliz` conflicts with import
> >> `bliz.ecs.table.bliz` at
> >> project\ecs\include\d2\bliz\ecs\table.d(5)
> >
> > I can't help because the examples are incomplete. There is no line 5 in table.d, nor a line 7 in component_access.d The error messages are not generated from the code posted.
>
> That's all you need really, any symbol you add will cause the error.
>
> extern(C++, bliz):
>
> created a symbol "bliz", you can't import a package from "bliz" cause then there's a symbol clash. I thought you implemented extern(C++) ...

And yes, the example is actually complete. Again, but I'll simplify the filenames:

ns/bar.d
-------------
module ns.bar;
import ns.baz;
extern(C++, ns):

ns/baz.d
-------------
module ns.baz;
import ns.bar;
extern(C++, ns):


> dmd ns/bar.d ns/baz.d
September 05, 2018
On Wednesday, 5 September 2018 at 00:35:50 UTC, Manu wrote:
> On Tue, 4 Sep 2018 at 17:30, tide via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>>
>> On Tuesday, 4 September 2018 at 23:32:31 UTC, Walter Bright wrote:
>> > On 9/4/2018 3:33 PM, Manu wrote:
>> >> file1.d
>> >> ---------
>> >> module bliz.ecs.component_access;
>> >> import bliz.ecs.table;
>> >> import bliz.ecs.types;
>> >> extern(C++, bliz):
>> >> // things...
>> >>
>> >> Error: project\ecs\include\d2\bliz\ecs\component_access.d(7):
>> >> Error:
>> >> namespace `bliz.ecs.component_access.bliz` conflicts with
>> >> import
>> >> `bliz.ecs.component_access.bliz` at
>> >> project\ecs\include\d2\bliz\ecs\component_access.d(3)
>> >>
>> >> file2.d
>> >> ---------
>> >> module bliz.ecs.table;
>> >> import bliz.ecs.types;
>> >> extern(C++, bliz):
>> >> // things...
>> >>
>> >> Error: project\ecs\include\d2\bliz\ecs\table.d(11): Error:
>> >> namespace
>> >> `bliz.ecs.table.bliz` conflicts with import
>> >> `bliz.ecs.table.bliz` at
>> >> project\ecs\include\d2\bliz\ecs\table.d(5)
>> >
>> > I can't help because the examples are incomplete. There is no line 5 in table.d, nor a line 7 in component_access.d The error messages are not generated from the code posted.
>>
>> That's all you need really, any symbol you add will cause the error.
>>
>> extern(C++, bliz):
>>
>> created a symbol "bliz", you can't import a package from "bliz" cause then there's a symbol clash. I thought you implemented extern(C++) ...
>
> And yes, the example is actually complete. Again, but I'll simplify the filenames:
>
> ns/bar.d
> -------------
> module ns.bar;
> import ns.baz;
> extern(C++, ns):
>
> ns/baz.d
> -------------
> module ns.baz;
> import ns.bar;
> extern(C++, ns):
>
>
>> dmd ns/bar.d ns/baz.d

Judging by the name of the modules are you working on an Entity Component System for D :o ?
September 04, 2018
On Tue, 4 Sep 2018 at 17:50, tide via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
>
> On Wednesday, 5 September 2018 at 00:35:50 UTC, Manu wrote:
> > On Tue, 4 Sep 2018 at 17:30, tide via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
> >>
> >> On Tuesday, 4 September 2018 at 23:32:31 UTC, Walter Bright wrote:
> >> > On 9/4/2018 3:33 PM, Manu wrote:
> >> >> file1.d
> >> >> ---------
> >> >> module bliz.ecs.component_access;
> >> >> import bliz.ecs.table;
> >> >> import bliz.ecs.types;
> >> >> extern(C++, bliz):
> >> >> // things...
> >> >>
> >> >> Error:
> >> >> project\ecs\include\d2\bliz\ecs\component_access.d(7):
> >> >> Error:
> >> >> namespace `bliz.ecs.component_access.bliz` conflicts with
> >> >> import
> >> >> `bliz.ecs.component_access.bliz` at
> >> >> project\ecs\include\d2\bliz\ecs\component_access.d(3)
> >> >>
> >> >> file2.d
> >> >> ---------
> >> >> module bliz.ecs.table;
> >> >> import bliz.ecs.types;
> >> >> extern(C++, bliz):
> >> >> // things...
> >> >>
> >> >> Error: project\ecs\include\d2\bliz\ecs\table.d(11): Error:
> >> >> namespace
> >> >> `bliz.ecs.table.bliz` conflicts with import
> >> >> `bliz.ecs.table.bliz` at
> >> >> project\ecs\include\d2\bliz\ecs\table.d(5)
> >> >
> >> > I can't help because the examples are incomplete. There is no line 5 in table.d, nor a line 7 in component_access.d The error messages are not generated from the code posted.
> >>
> >> That's all you need really, any symbol you add will cause the error.
> >>
> >> extern(C++, bliz):
> >>
> >> created a symbol "bliz", you can't import a package from "bliz" cause then there's a symbol clash. I thought you implemented extern(C++) ...
> >
> > And yes, the example is actually complete. Again, but I'll simplify the filenames:
> >
> > ns/bar.d
> > -------------
> > module ns.bar;
> > import ns.baz;
> > extern(C++, ns):
> >
> > ns/baz.d
> > -------------
> > module ns.baz;
> > import ns.bar;
> > extern(C++, ns):
> >
> >
> >> dmd ns/bar.d ns/baz.d
>
> Judging by the name of the modules are you working on an Entity Component System for D :o ?

Well, I'm clearly trying to call C++ code >_<
September 04, 2018
On 9/4/2018 5:31 PM, Manu wrote:
> I'm just showing one case that you tend to be confronted with
> immediately, which is that if you import a module, and then open a
> namespace with the same name as the root namespace of a module you
> imported, that is an error condition; the namespace conflicts with the
> root namespace of the import.

I have 30 years of experience doing tech support. I'm not going to guess what the problem is, or try to reconstruct an example from a handwavy description. Been there, done that, far too many times. It just wastes my time and will only frustrate you because I'll solve a different problem.
« First   ‹ Prev
1 2 3 4 5 6