Re: Interfacing C++ to D

2017-04-02 Thread ANtlord via Digitalmars-d-learn
On Saturday, 1 April 2017 at 16:39:28 UTC, FreeSlave wrote: This page has many examples. Which exactly do you try to run and how do you build it? Which compilers, OS? My bad. I've tested example under caption Using C++ Classes From D. I used several combinations of compilers, and no one works

Re: Interfacing C++ to D

2017-04-02 Thread ANtlord via Digitalmars-d-learn
On Sunday, 2 April 2017 at 09:58:19 UTC, ANtlord wrote: On Saturday, 1 April 2017 at 16:39:28 UTC, FreeSlave wrote: This page has many examples. Which exactly do you try to run and how do you build it? Which compilers, OS? My bad. I've tested example under caption Using C++ Classes From D. I

Experimental xml set up

2017-04-02 Thread Begah via Digitalmars-d-learn
To load up 3D models in my application, i decided to use the COLLADA model format, to do that i need to be able to extract information out of an xml file. Since std.xml is going to be deprecated eventually, is opted to try and use std.experiment.xml. So i created a test project and added thi

Re: Experimental xml set up

2017-04-02 Thread rikki cattermole via Digitalmars-d-learn
On 02/04/2017 2:58 PM, Begah wrote: To load up 3D models in my application, i decided to use the COLLADA model format, to do that i need to be able to extract information out of an xml file. Since std.xml is going to be deprecated eventually, is opted to try and use std.experiment.xml. So i cre

Re: Need advice on using DUB registry

2017-04-02 Thread Eric via Digitalmars-d-learn
On Sunday, 2 April 2017 at 04:14:56 UTC, rikki cattermole wrote: On 02/04/2017 2:37 AM, Eric wrote: I'm planning on some day putting a package in the DUB registry. My package is dependent on my "util" package which is a collection of stuff I use across all my projects. Does this mean I als

Re: Need advice on using DUB registry

2017-04-02 Thread drug via Digitalmars-d-learn
02.04.2017 17:43, Eric пишет: On Sunday, 2 April 2017 at 04:14:56 UTC, rikki cattermole wrote: On 02/04/2017 2:37 AM, Eric wrote: I'm planning on some day putting a package in the DUB registry. My package is dependent on my "util" package which is a collection of stuff I use across all my pro

Re: Experimental xml set up

2017-04-02 Thread Begah via Digitalmars-d-learn
On Sunday, 2 April 2017 at 14:15:50 UTC, rikki cattermole wrote: On 02/04/2017 2:58 PM, Begah wrote: [...] Quite out of date. Here is some code that worked for me: string raw_input = ...; auto domBuilder = raw_input .lexer .parser

Re: Interfacing C++ to D

2017-04-02 Thread FreeSlave via Digitalmars-d-learn
On Sunday, 2 April 2017 at 09:58:19 UTC, ANtlord wrote: On Saturday, 1 April 2017 at 16:39:28 UTC, FreeSlave wrote: This page has many examples. Which exactly do you try to run and how do you build it? Which compilers, OS? My bad. I've tested example under caption Using C++ Classes From D. I

Re: Interfacing C++ to D

2017-04-02 Thread FreeSlave via Digitalmars-d-learn
On Sunday, 2 April 2017 at 16:02:06 UTC, FreeSlave wrote: On Sunday, 2 April 2017 at 09:58:19 UTC, ANtlord wrote: On Saturday, 1 April 2017 at 16:39:28 UTC, FreeSlave wrote: This page has many examples. Which exactly do you try to run and how do you build it? Which compilers, OS? My bad. I've

Re: Interfacing C++ to D

2017-04-02 Thread FreeSlave via Digitalmars-d-learn
On Sunday, 2 April 2017 at 16:03:51 UTC, FreeSlave wrote: On Sunday, 2 April 2017 at 16:02:06 UTC, FreeSlave wrote: On Sunday, 2 April 2017 at 09:58:19 UTC, ANtlord wrote: [...] Now I see. 'Using C++ Classes From D' crashes for me too. It also returns the wrong value from 'field' method. Sho

Re: pointer not aligned

2017-04-02 Thread Timothee Cour via Digitalmars-d-learn
indeed. NOTE: ldmd2/ldc2 doens't have this issue to reproduce: ``` rdmd --force --eval='writeln(`hello`)' ``` ld: warning: pointer not aligned at address 0x1000BE0B9 (_D53TypeInfo_S3std5array17__T8AppenderTAyaZ8Appender4Data6__initZ + 24 from .rdmd-501/rdmd-eval.o) with `--compiler=ldmd2`

Re: pointer not aligned

2017-04-02 Thread Jon Degenhardt via Digitalmars-d-learn
On Friday, 31 March 2017 at 04:41:10 UTC, Joel wrote: Linking... ld: warning: pointer not aligned at address 0x10017A4C9 (_D30TypeInfo_AxS3std4file8DirEntry6__initZ + 16 from .dub/build/application-debug-posix.osx-x86_64-dmd_2072-EFDCDF4D45F944F7A9B1AEA5C32F81ED/spellit.o) ... and this goes o

delegate with optional parameters

2017-04-02 Thread Inquie via Digitalmars-d-learn
is it possible to create a delegate that takes an optional number of parameters and/or return type? T delegate(S...)(S) special_delegate; I guess this is impossible?

Write file at compile time?

2017-04-02 Thread Inquie via Digitalmars-d-learn
I would like to write the output of a manifest constant at compile time to a file instead of console using pragma(msg). Is this possible?

Re: delegate with optional parameters

2017-04-02 Thread Basile B. via Digitalmars-d-learn
On Sunday, 2 April 2017 at 19:24:14 UTC, Inquie wrote: is it possible to create a delegate that takes an optional number of parameters and/or return type? T delegate(S...)(S) special_delegate; I guess this is impossible? alias Dg(Return, Params...) = Return delegate(Params); Dg!(int,float,

Re: delegate with optional parameters

2017-04-02 Thread Inquie via Digitalmars-d-learn
On Sunday, 2 April 2017 at 20:02:56 UTC, Basile B. wrote: On Sunday, 2 April 2017 at 19:24:14 UTC, Inquie wrote: is it possible to create a delegate that takes an optional number of parameters and/or return type? T delegate(S...)(S) special_delegate; I guess this is impossible? alias Dg(Ret

Covert a complex C header to D

2017-04-02 Thread biocyberman via Digitalmars-d-learn
khash.h (http://attractivechaos.github.io/klib/#Khash%3A%20generic%20hash%20table) is a part of klib library in C. I want to covert it to D in the process of learning deeper about D. First I tried with Dstep (https://github.com/jacob-carlborg/dstep) and read the C to D article (https://dlang.o

Re: delegate with optional parameters

2017-04-02 Thread Basile B. via Digitalmars-d-learn
On Sunday, 2 April 2017 at 20:48:09 UTC, Inquie wrote: On Sunday, 2 April 2017 at 20:02:56 UTC, Basile B. wrote: On Sunday, 2 April 2017 at 19:24:14 UTC, Inquie wrote: is it possible to create a delegate that takes an optional number of parameters and/or return type? T delegate(S...)(S) speci

Re: Write file at compile time?

2017-04-02 Thread Basile B. via Digitalmars-d-learn
On Sunday, 2 April 2017 at 19:42:52 UTC, Inquie wrote: I would like to write the output of a manifest constant at compile time to a file instead of console using pragma(msg). Is this possible? No.

Re: delegate with optional parameters

2017-04-02 Thread Inquie via Digitalmars-d-learn
On Sunday, 2 April 2017 at 21:47:55 UTC, Basile B. wrote: On Sunday, 2 April 2017 at 20:48:09 UTC, Inquie wrote: On Sunday, 2 April 2017 at 20:02:56 UTC, Basile B. wrote: On Sunday, 2 April 2017 at 19:24:14 UTC, Inquie wrote: is it possible to create a delegate that takes an optional number of

Re: Covert a complex C header to D

2017-04-02 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 2 April 2017 at 21:43:52 UTC, biocyberman wrote: khash.h (http://attractivechaos.github.io/klib/#Khash%3A%20generic%20hash%20table) is a part of klib library in C. I want to covert it to D in the process of learning deeper about D. First I tried with Dstep (https://github.com/jacob-

Re: Covert a complex C header to D

2017-04-02 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 2 April 2017 at 21:43:52 UTC, biocyberman wrote: template __KHASH_TYPE(string name){ "struct kh_" ~ name ~"_t { " ~ "khint_t n_buckets, size, n_occupied, upper_bound; " ~ "khint32_t *flags; " ~ "khkey_t *keys; " ~ "kh

Re: delegate with optional parameters

2017-04-02 Thread Ali Çehreli via Digitalmars-d-learn
On 04/02/2017 03:24 PM, Inquie wrote: >> Show a usage, someone certainly propose a pattern that does the job. > > int delegate() f; > void delegate(int) f; That won't work because both of those are variables and variables don't have overloading. > These are effectively overload methods, but m

Re: delegate with optional parameters

2017-04-02 Thread Inquie via Digitalmars-d-learn
On Monday, 3 April 2017 at 03:08:22 UTC, Ali Çehreli wrote: On 04/02/2017 03:24 PM, Inquie wrote: >> Show a usage, someone certainly propose a pattern that does the job. > > int delegate() f; > void delegate(int) f; That won't work because both of those are variables and variables don't have o