hijack dub test

2017-08-30 Thread Nicholas Wilson via Digitalmars-d-learn
My project is a library, but I also need to test it and unit tests won't cut it (external hardware). How do you set up the dub.json to build the library normally but when it is invoked with `dub test` it runs a separate configuration that also includes files in the `source/test` folder, but a

Re: Bug in D!!!

2017-08-30 Thread Ali Çehreli via Digitalmars-d-learn
On 08/30/2017 05:49 PM, EntangledQuanta wrote: > The compiler can and should do this! Yes, the compiler can do it for each compilation but there is also the feature called /separate compilation/ that D supports. With separate compilation, there would potentially be multiple different and inco

Re: DIPs - question about mores, etiquette and DIP1009 in particular

2017-08-30 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 22:50:22 UTC, Cecil Ward wrote: On Wednesday, 30 August 2017 at 22:09:21 UTC, Mike Parker wrote: On Wednesday, 30 August 2017 at 17:16:11 UTC, Cecil Ward wrote: DIPs are not voted on. Thanks for letting me know, answers my question. Our leaders would perhaps f

Re: Bug in D!!!

2017-08-30 Thread EntangledQuanta via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 22:52:41 UTC, Adam D. Ruppe wrote: On Wednesday, 30 August 2017 at 20:47:12 UTC, EntangledQuanta wrote: This is quite surprising! In the new version pending release (scheduled for later this week), we get a new feature `static foreach` that will let you loop t

Re: -betterC not working

2017-08-30 Thread SrMordred via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 22:45:27 UTC, Adam D. Ruppe wrote: On Wednesday, 30 August 2017 at 22:18:07 UTC, SrMordred wrote: DMD64 D Compiler v2.075.1 -betterC as described recently is not yet released. https://dlang.org/changelog/2.076.0_pre.html is where it gets the new behavior, and

Re: DIPs - question about mores, etiquette and DIP1009 in particular

2017-08-30 Thread ketmar via Digitalmars-d-learn
Cecil Ward wrote: On Wednesday, 30 August 2017 at 17:19:52 UTC, ketmar wrote: it is explicitly stated in DIP that existing syntax will not be deprecated/removed. i guess that reading the DIP before expressing your opinion is the prerequisite... Good to know. A relief. I am full of pain dru

Re: Bug in D!!!

2017-08-30 Thread EntangledQuanta via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 22:08:03 UTC, Jonathan M Davis wrote: On Wednesday, August 30, 2017 21:51:57 EntangledQuanta via Digitalmars-d- learn wrote: [...] Templates have no idea what arguments you intend to use with them. You can pass them any arguments you want, and as long as they

Re: Bug in D!!!

2017-08-30 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 20:47:12 UTC, EntangledQuanta wrote: This is quite surprising! In the new version pending release (scheduled for later this week), we get a new feature `static foreach` that will let you loop through the types you want and declare all the functions that way.

Re: DIPs - question about mores, etiquette and DIP1009 in particular

2017-08-30 Thread Cecil Ward via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 22:09:21 UTC, Mike Parker wrote: On Wednesday, 30 August 2017 at 17:16:11 UTC, Cecil Ward wrote: DIPs are not voted on. Thanks for letting me know, answers my question. Our leaders would perhaps find a simple pair of numbers to be a useful additional metric? D

Re: Bug in D!!!

2017-08-30 Thread EntangledQuanta via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 22:08:03 UTC, Jonathan M Davis wrote: On Wednesday, August 30, 2017 21:51:57 EntangledQuanta via Digitalmars-d- learn wrote: The point you are trying to making, and not doing a great job, is that the compiler cannot create an unknown set of virtual functions from

Re: DIPs - question about mores, etiquette and DIP1009 in particular

2017-08-30 Thread Cecil Ward via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 17:19:52 UTC, ketmar wrote: it is explicitly stated in DIP that existing syntax will not be deprecated/removed. i guess that reading the DIP before expressing your opinion is the prerequisite... Good to know. A relief. I am full of pain drugs and missed the no

Re: -betterC not working

2017-08-30 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 22:18:07 UTC, SrMordred wrote: DMD64 D Compiler v2.075.1 -betterC as described recently is not yet released. https://dlang.org/changelog/2.076.0_pre.html is where it gets the new behavior, and that isn't scheduled for formal release until the end of the week.

-betterC not working

2017-08-30 Thread SrMordred via Digitalmars-d-learn
On Ubuntu: //dub.json { "name": "d_betterc", "dflags" : ["-betterC"] } //source/app.d import std.stdio; extern (C) int main(int argc, char** argv) { int[] x; writeln(x); return 0; } //cmd dub run --config=application --arch=x86_64 --build=debug --compiler=dmd //or dmd -bette

Re: DIPs - question about mores, etiquette and DIP1009 in particular

2017-08-30 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 17:16:11 UTC, Cecil Ward wrote: Is there a way I can simply register my vote eg about DIP 1009? My vote is 'no thanks'. Like the existing system, don't care about the alleged verbosity / room thing, and please whatever do not deprecate the existing syntax because

Re: Bug in D!!!

2017-08-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, August 30, 2017 21:51:57 EntangledQuanta via Digitalmars-d- learn wrote: > The point you are trying to making, and not doing a great job, is > that the compiler cannot create an unknown set of virtual > functions from a single templated virtual function. BUT, when you > realize that i

Re: Bug in D!!!

2017-08-30 Thread EntangledQuanta via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 21:33:30 UTC, Jonathan M Davis wrote: On Wednesday, August 30, 2017 20:47:12 EntangledQuanta via Digitalmars-d- learn wrote: This is quite surprising! public struct S(T) { T s; } interface I { void Go(T)(S!T s); static final I New() { return new

Re: Protection attribute in another module

2017-08-30 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 21:15:56 UTC, Kagamin wrote: Something like mixin("__traits(getProtection, A."~member~")") The following compiles without error. It would be nice if something like this got added to std.traits. template getProtection(string from, string member) { mixin("st

Re: Bug in D!!!

2017-08-30 Thread lobo via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 20:47:12 UTC, EntangledQuanta wrote: This is quite surprising! public struct S(T) { T s; } interface I { void Go(T)(S!T s); static final I New() { return new C(); } } abstract class A : I {

Re: Bug in D!!!

2017-08-30 Thread EntangledQuanta via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 21:13:19 UTC, Kagamin wrote: It can't work this way. You can try std.variant. Sure it can! What are you talking about! std.variant has nothing to do with it! It works if T is hard coded, so it should work generically. What's the point of templates variables if

Re: Bug in D!!!

2017-08-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, August 30, 2017 20:47:12 EntangledQuanta via Digitalmars-d- learn wrote: > This is quite surprising! > > public struct S(T) > { > T s; > } > > > interface I > { > void Go(T)(S!T s); > > static final I New() > { > return new C(); > } > } > > abstract class A : I > { > >

Re: Protection attribute in another module

2017-08-30 Thread Kagamin via Digitalmars-d-learn
Something like mixin("__traits(getProtection, A."~member~")")

Re: Bug in D!!!

2017-08-30 Thread Kagamin via Digitalmars-d-learn
It can't work this way. You can try std.variant.

Re: OpenMAX bindings

2017-08-30 Thread Francis Nixon via Digitalmars-d-learn
On Friday, 25 August 2017 at 03:34:00 UTC, Johnson wrote: Anyone? Since OpenMAX provides header files you can convert them to d using this: https://dlang.org/htod.html You can then link your d code with OpenMAX.

Bug in D!!!

2017-08-30 Thread EntangledQuanta via Digitalmars-d-learn
This is quite surprising! public struct S(T) { T s; } interface I { void Go(T)(S!T s); static final I New() { return new C(); } } abstract class A : I { } class C : A { void Go(T)(S!T s) {

Re: fasta parser with iopipe?

2017-08-30 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/28/17 10:08 AM, biocyberman wrote: @Steve: Yes we talked at dconf 2017. I had to other things so D learning got slow down. I am trying with Fasta format before jumping to Fastq again. The jsoniopipe is full feature, and relatively small project, which can be used to study case. However th

Re: DIPs - question about mores, etiquette and DIP1009 in particular

2017-08-30 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Aug 30, 2017 at 05:16:11PM +, Cecil Ward via Digitalmars-d-learn wrote: > Is there a way I can simply register my vote eg about DIP 1009? My > vote is 'no thanks'. Like the existing system, don't care about the > alleged verbosity / room thing, and please whatever do not deprecate > th

Re: DIPs - question about mores, etiquette and DIP1009 in particular

2017-08-30 Thread ketmar via Digitalmars-d-learn
Cecil Ward wrote: Is there a way I can simply register my vote eg about DIP 1009? My vote is 'no thanks'. Like the existing system, don't care about the alleged verbosity / room thing, and please whatever do not deprecate the existing syntax because I use it all over the place and the blocks c

DIPs - question about mores, etiquette and DIP1009 in particular

2017-08-30 Thread Cecil Ward via Digitalmars-d-learn
Is there a way I can simply register my vote eg about DIP 1009? My vote is 'no thanks'. Like the existing system, don't care about the alleged verbosity / room thing, and please whatever do not deprecate the existing syntax because I use it all over the place and the blocks can have complex cod

Re: "Range invalidation" ?

2017-08-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, August 30, 2017 13:28:48 Mark via Digitalmars-d-learn wrote: > C++ has the issue of iterator invalidation, where certain > operations on a container while iterating on it may invalidate > the iterator, in which case it is no longer safe to use the > iterator. > > D has ranges, but pre

Re: writeln() sometimes double prints from main() if I run a thread checking for input?

2017-08-30 Thread Ivan Kazmenko via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 13:24:55 UTC, Ivan Kazmenko wrote: On Wednesday, 30 August 2017 at 10:55:20 UTC, Timothy Foster wrote: import std.stdio, core.thread; void main(){ auto thread = new Thread(&func).start; writeln("Output"); writeln("Output2"); wr

"Range invalidation" ?

2017-08-30 Thread Mark via Digitalmars-d-learn
C++ has the issue of iterator invalidation, where certain operations on a container while iterating on it may invalidate the iterator, in which case it is no longer safe to use the iterator. D has ranges, but presumably the same issue can arise in D. For instance, if I have a ForwardRange and

Re: writeln() sometimes double prints from main() if I run a thread checking for input?

2017-08-30 Thread Ivan Kazmenko via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 10:55:20 UTC, Timothy Foster wrote: import std.stdio, core.thread; void main(){ auto thread = new Thread(&func).start; writeln("Output"); writeln("Output2"); writeln("Output3"); while(true){} } void func(){ foreach(

Re: writeln() sometimes double prints from main() if I run a thread checking for input?

2017-08-30 Thread Timothy Foster via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 11:28:49 UTC, Stefan Koch wrote: On Wednesday, 30 August 2017 at 10:55:20 UTC, Timothy Foster wrote: On Wednesday, 30 August 2017 at 10:44:43 UTC, Ivan Kazmenko wrote: [...] import std.stdio, core.thread; void main(){ auto thread = new Thread(&func

Re: writeln() sometimes double prints from main() if I run a thread checking for input?

2017-08-30 Thread Stefan Koch via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 10:55:20 UTC, Timothy Foster wrote: On Wednesday, 30 August 2017 at 10:44:43 UTC, Ivan Kazmenko wrote: On Wednesday, 30 August 2017 at 10:13:57 UTC, Timothy Foster wrote: I'm not sure if this is a known issue, or if I just don't understand how to use threads, but

Re: writeln() sometimes double prints from main() if I run a thread checking for input?

2017-08-30 Thread Timothy Foster via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 10:44:43 UTC, Ivan Kazmenko wrote: On Wednesday, 30 August 2017 at 10:13:57 UTC, Timothy Foster wrote: I'm not sure if this is a known issue, or if I just don't understand how to use threads, but I've got writeln statements sometimes printing out twice in some ar

Re: writeln() sometimes double prints from main() if I run a thread checking for input?

2017-08-30 Thread Ivan Kazmenko via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 10:13:57 UTC, Timothy Foster wrote: I'm not sure if this is a known issue, or if I just don't understand how to use threads, but I've got writeln statements sometimes printing out twice in some areas of my code. <...> Does anyone know what is causing this or how

writeln() sometimes double prints from main() if I run a thread checking for input?

2017-08-30 Thread Timothy Foster via Digitalmars-d-learn
I'm not sure if this is a known issue, or if I just don't understand how to use threads, but I've got writeln statements sometimes printing out twice in some areas of my code. It seems to only happen when I start a thread that checks for input with stdin.byLineCopy (I'm not sure of the internal

Re: Missing array element

2017-08-30 Thread Biotronic via Digitalmars-d-learn
On Wednesday, 30 August 2017 at 06:16:16 UTC, Vino.B wrote: On Tuesday, 29 August 2017 at 18:39:03 UTC, Ali Çehreli wrote: https://dlang.org/phobos/std_algorithm_setops.html#.setDifference I tried the setDifference but does seem to be working as expected From the documentation of setDiffe