Re: Request Assistance Calling D from C++: weird visibility issue inside struct and namespace

2017-11-07 Thread Andrew Edwards via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 07:06:39 UTC, Nicholas Wilson wrote: On Wednesday, 8 November 2017 at 06:34:27 UTC, Andrew Edwards wrote: I'm having a little bit of problem calling D code from C++ and would appreciate some assistance. First, given the following C++ program wich compiles,

Re: Request Assistance Calling D from C++: weird visibility issue inside struct and namespace

2017-11-07 Thread evilrat via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 06:34:27 UTC, Andrew Edwards wrote: Modify example.cpp to: == // example.cpp #include "example.h" namespace SomeApi {} struct SomeStruct {} void call_cpp() { foo("do great things"); return; }

Re: Request Assistance Calling D from C++: weird visibility issue inside struct and namespace

2017-11-07 Thread Nicholas Wilson via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 06:34:27 UTC, Andrew Edwards wrote: I'm having a little bit of problem calling D code from C++ and would appreciate some assistance. First, given the following C++ program wich compiles, links, and runs without any problem: Try using `nm` on the C++ object to

Request Assistance Calling D from C++: weird visibility issue inside struct and namespace

2017-11-07 Thread Andrew Edwards via Digitalmars-d-learn
I'm having a little bit of problem calling D code from C++ and would appreciate some assistance. First, given the following C++ program wich compiles, links, and runs without any problem: == // example.h SOME_API void foo(const char* str); // example.cpp

Re: How do i find a list of the methods Object implements, or maybe just locate the 'write' method?

2017-11-07 Thread codephantom via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 03:33:08 UTC, bauss wrote: -- Compiles fine with DMD: https://dpaste.dzfl.pl/95b896aa242f ahh.. that site saves it with some random temporary file name I assume. If it saved it as

Re: How do i find a list of the methods Object implements, or maybe just locate the 'write' method?

2017-11-07 Thread codephantom via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 03:33:08 UTC, bauss wrote: -- Compiles fine with DMD: https://dpaste.dzfl.pl/95b896aa242f you saved it as?: write.d you didn't add in a module statement? and it compiled??

Re: How do i find a list of the methods Object implements, or maybe just locate the 'write' method?

2017-11-07 Thread bauss via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 03:05:22 UTC, codephantom wrote: On Tuesday, 7 November 2017 at 21:32:26 UTC, Adam D. Ruppe wrote: [...] it's interesting how the compiler deals with scope. --- // save this in a file

Re: How do i find a list of the methods Object implements, or maybe just locate the 'write' method?

2017-11-07 Thread codephantom via Digitalmars-d-learn
On Tuesday, 7 November 2017 at 21:32:26 UTC, Adam D. Ruppe wrote: On Tuesday, 7 November 2017 at 21:25:00 UTC, dan wrote: I looked in my distribution's object.d (debian stretch, gdc, in Did you import std.stdio in the file? If so, it is calling the std.stdio.write on the object (this is

Re: How do i find a list of the methods Object implements, or maybe just locate the 'write' method?

2017-11-07 Thread dan via Digitalmars-d-learn
On Tuesday, 7 November 2017 at 21:32:26 UTC, Adam D. Ruppe wrote: On Tuesday, 7 November 2017 at 21:25:00 UTC, dan wrote: I looked in my distribution's object.d (debian stretch, gdc, in Did you import std.stdio in the file? If so, it is calling the std.stdio.write on the object (this is

Re: How do i find a list of the methods Object implements, or maybe just locate the 'write' method?

2017-11-07 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 7 November 2017 at 21:25:00 UTC, dan wrote: I looked in my distribution's object.d (debian stretch, gdc, in Did you import std.stdio in the file? If so, it is calling the std.stdio.write on the object (this is called UFCS, uniform function call syntax, the language allows you to

How do i find a list of the methods Object implements, or maybe just locate the 'write' method?

2017-11-07 Thread dan via Digitalmars-d-learn
I was writing some code and added a line like x.write; expecting to fill it in later. I forgot to actually write a function write, but it compiled anyway, and some testing shows that if you write auto o = new Object; o.write; then this compiles just fine. (The 'write' method,

Re: Cyclic dependency error

2017-11-07 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 7 November 2017 at 14:05:41 UTC, Steven Schveighoffer wrote: On 11/7/17 7:49 AM, Tony wrote: My program compiled, but when I ran it I got this error message: object.Error@src/rt/minfo.d(371): Cyclic dependency between module variable and main variable* -> misc -> main* ->

Re: Cyclic dependency error

2017-11-07 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/7/17 7:49 AM, Tony wrote: My program compiled, but when I ran it I got this error message: object.Error@src/rt/minfo.d(371): Cyclic dependency between module variable and main variable* -> misc -> main* -> variable* I take it that the -> represents a dependency from the module on that

Re: ddox empty public methods/interfaces etc

2017-11-07 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/6/17 11:01 PM, Andrey wrote: Hello is there way to automatically generate documentation for public methods, interfaces, fields etc.? e.g. now I should write somethink like this to generate documentation for enum Bacgkround: /// enum Background {     transparent,  ///     light,  ///    

Re: Any book recommendation for writing a compiler?

2017-11-07 Thread Tony via Digitalmars-d-learn
Author Allen Holub has made his out-of-print book, Compiler Design in C, available as a free pdf download: http://holub.com/compiler/ And Torben Mogensen is doing the same with his more recent Basics of Compiler Design: http://www.diku.dk/~torbenm/Basics/

Cyclic dependency error

2017-11-07 Thread Tony via Digitalmars-d-learn
My program compiled, but when I ran it I got this error message: object.Error@src/rt/minfo.d(371): Cyclic dependency between module variable and main variable* -> misc -> main* -> variable* I take it that the -> represents a dependency from the module on that line, to the module on the line

Re: Any book recommendation for writing a compiler?

2017-11-07 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Tuesday, 7 November 2017 at 01:30:14 UTC, Basile B. wrote: On Saturday, 4 November 2017 at 20:28:17 UTC, Ola Fosheim Grøstad wrote: On Saturday, 4 November 2017 at 15:51:30 UTC, Basile B. wrote: People who say that after reading the dragon book, you will program your own programming