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

2017-11-08 Thread Andrew Edwards via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 07:30:34 UTC, evilrat wrote: On Wednesday, 8 November 2017 at 06:34:27 UTC, Andrew Edwards just using fully qualified name didn't make it? void call_cpp() { ::foo("do great things"); // calling global foo return; } No, it did not. Are you sure you p

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

2017-11-08 Thread Petar via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 07:55:02 UTC, Andrew Edwards wrote: On Wednesday, 8 November 2017 at 07:30:34 UTC, evilrat wrote: On Wednesday, 8 November 2017 at 06:34:27 UTC, Andrew Edwards just using fully qualified name didn't make it? void call_cpp() { ::foo("do great things"); // ca

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

2017-11-08 Thread bauss via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 03:48:58 UTC, codephantom wrote: 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

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

2017-11-08 Thread codephantom via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 12:17:14 UTC, bauss wrote: That's because the module name becomes `write` then. yeah I knew that. I was trying to demonstrate how (when the module name is 'write'), then the compiler is ok with: o.write; but not: write(o); even though semantically they a

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

2017-11-08 Thread codephantom via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 12:48:41 UTC, codephantom wrote: Apparently its a bug in LDC (but personally, it's a bug I like). mistyped: I meant a bug in GDC, not LDC.

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

2017-11-08 Thread MGW 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: The useful material. https://www.yout

User input

2017-11-08 Thread Namal via Digitalmars-d-learn
Is there any other way to do a simple user input into integer variables without using std.conv?

Distinct "static" parent property contents for children

2017-11-08 Thread Timoses via Digitalmars-d-learn
Hey, wrapping my head around this atm.. How would I achieve that children statically set a property of the parent so that the property is distinct between different children? The following is *bs*, but kind of illustrates what I'd "like": class Base { int x; } class A : Base { stat

Re: Distinct "static" parent property contents for children

2017-11-08 Thread Timoses via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 17:38:27 UTC, Timoses wrote: Option 2: class Base { int x;} class A : Base { this() { x = 1; } } class B : Base { this() { x = 2; } } Con: Well, the downside is that every instance of A and B allocates space for x although only one allocation would be r

Re: Distinct "static" parent property contents for children

2017-11-08 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 17:38:27 UTC, Timoses wrote: Are there better options/ways of achieving this? What are you actually trying to achieve? What are you using these variables for? My first thought is you should abandon the variable approach and just use an abstract function that

Re: User input

2017-11-08 Thread Ali Çehreli via Digitalmars-d-learn
On 11/08/2017 09:19 AM, Namal wrote: Is there any other way to do a simple user input into integer variables without using std.conv? import std.stdio; void main() { int i; readf(" %s", &i);// You can use %d as well // You can wrap readf in a function template for a more natura

Re: Distinct "static" parent property contents for children

2017-11-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/8/17 12:38 PM, Timoses wrote: Hey, wrapping my head around this atm.. [snip] so what you want is a static variable per subclass, but that the base class can access. What I would recommend is this: abstract class Base { int x(); } class A : Base { private static int _x = 1;

Re: ddox empty public methods/interfaces etc

2017-11-08 Thread Andrey via Digitalmars-d-learn
On Tuesday, 7 November 2017 at 14:02:28 UTC, Steven Schveighoffer wrote: 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 Bac

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

2017-11-08 Thread Andrew Edwards via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 15:12:05 UTC, MGW wrote: The useful material. https://www.youtube.com/watch?v=HTgJaRRfLPk Useful indeed, thank you.

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

2017-11-08 Thread Andrew Edwards via Digitalmars-d-learn
On Wednesday, 8 November 2017 at 08:42:01 UTC, Petar Kirov [ZombineDev] wrote: Walter has recently been working on improving the C++ mangling, so be sure to test the latest dmd nightly build and if that doesn't work be sure to file bug report(s). https://github.com/dlang/dmd/pull/7250 https:

Re: std.functional.compose compilation error

2017-11-08 Thread Chuck Allison via Digitalmars-d-learn
On Thursday, 25 August 2016 at 14:06:32 UTC, Antonio Corbi wrote: Hello, Trying to compile this example from Chuck Allison: --- import std.stdio; import std.functional; void main() { auto div3 = (double x) => x/3.0; auto sq = (double x) => x*x;

Re: std.functional.compose compilation error

2017-11-08 Thread Andrew Edwards via Digitalmars-d-learn
On Thursday, 9 November 2017 at 04:58:19 UTC, Chuck Allison wrote: Chuck Allison Sorry to hijack this thread but it shan't be helped. Chuck, how is it going? Curious about the status of "Thinking in D". How do I go about participating in the draft review? -- Andrew

Re: std.functional.compose compilation error

2017-11-08 Thread Andrew Edwards via Digitalmars-d-learn
On Thursday, 9 November 2017 at 05:07:33 UTC, Andrew Edwards wrote: On Thursday, 9 November 2017 at 04:58:19 UTC, Chuck Allison wrote: Chuck Allison Sorry to hijack this thread but it shan't be helped. Chuck, how is it going? Curious about the status of "Thinking in D". How do I go about pa

Re: std.functional.compose compilation error

2017-11-08 Thread codephantom via Digitalmars-d-learn
On Thursday, 9 November 2017 at 04:58:19 UTC, Chuck Allison wrote: As others have said, rename the .d file, since files are considered modules. I have since changed my notes to reflect this change. Sorry for the confusion. Chuck Allison When coming to a new language I tend to write lots of