Filter AA at compile time

2018-12-26 Thread Andrey via Digitalmars-d-learn
Hi, I want to filter AA at compile time and do this: void main() { // datamap is some AA enum qaz = "qq"; enum types = datamap.byKeyValue.filter!(pair => qaz.isGood(pair)).assocArray(); types.writeln; } But compiler says: Error: _aaRange cannot be interpreted at compile time,

Re: Determination of thread status.

2018-12-26 Thread Vitaly via Digitalmars-d-learn
Maybe use spawnLinked()? https://run.dlang.io/is/9xbyAF Thanks. At the moment, I implemented it through sending a message, and receiveTimeout receiving, if the response is not received after the timeout expires, then it is considered that the has terminated. Probably this is not right, but I

Re: typeof function literals which define the types of its parameters but do not give their parameters names

2018-12-26 Thread Paul Backus via Digitalmars-d-learn
On Thursday, 27 December 2018 at 03:52:52 UTC, Johannes Loher wrote: Hey all, I am a bit confused about the inferred types of function literals which do not name their parameters (something like `(int) {}`). The confusion arises from the fact that the inferred type sometimes is `void` (might

Re: typeof function literals which define the types of its parameters but do not give their parameters names

2018-12-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/26/18 10:52 PM, Johannes Loher wrote: Hey all, I am a bit confused about the inferred types of function literals which do not name their parameters (something like `(int) {}`). The confusion arises from the fact that the inferred type sometimes is `void` (might be the case, because the

typeof function literals which define the types of its parameters but do not give their parameters names

2018-12-26 Thread Johannes Loher via Digitalmars-d-learn
Hey all, I am a bit confused about the inferred types of function literals which do not name their parameters (something like `(int) {}`). The confusion arises from the fact that the inferred type sometimes is `void` (might be the case, because the function literal is inferred to be a templat

Re: Determination of thread status.

2018-12-26 Thread Bastiaan Veelo via Digitalmars-d-learn
On Wednesday, 26 December 2018 at 05:43:47 UTC, Vitaly wrote: On Tuesday, 25 December 2018 at 17:08:00 UTC, Neia Neutuladh wrote: 1. Find the Thread object: Tid threadId = spawn(&doStuff); auto thread = Thread.getAll.filter!(x => x.id == threadId).front; 2. Check the `isRunning` property.

Should this library binding work?

2018-12-26 Thread solidstate1991 via Digitalmars-d-learn
https://github.com/ZILtoid1991/bindbc-zstandard After looking for alternatives to my megaproject of porting LZHAM to D (since it had several issues, I'll salvaging my tar implementation as well as another archive format meant for application data storage), I found out that zstandard not only

Re: mir.ndslice: assign a vector to a matrix row

2018-12-26 Thread 9il via Digitalmars-d-learn
On Saturday, 15 December 2018 at 19:04:37 UTC, David wrote: Hi I am wondering if it is possible to assign a vector to a row of a matrix? main.d == import mir.ndslice; void main() { auto matrix = slice!double(3, 4); matrix[] = 0; matrix.diagonal[] = 1; auto row

Re: Are the below statements equivalent?

2018-12-26 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 26 December 2018 at 17:33:13 UTC, Machine Code wrote: Are the below statements equivalent? Yes, it is defined here: https://dlang.org/spec/statement.html#switch-statement (#2 in the list)

Are the below statements equivalent?

2018-12-26 Thread Machine Code via Digitalmars-d-learn
Give: enum Foo { a, b, c, d, e } Foo f = Foo.c; Are the below statements equivalent? switch(f) { case Foo.a: case Foo.b: doSomething(); break; // ... } and: (note the comma in the case) switch(f) { case Foo.a, Foo.b: doSomething(); break; // ... } I found it in

Re: Copyright for reworked Phobos code in Mir

2018-12-26 Thread bachmeier via Digitalmars-d-learn
On Wednesday, 26 December 2018 at 15:40:13 UTC, 9il wrote: std.numeric contains: Copyright: Copyright Andrei Alexandrescu 2008 - 2009. What copyright should contain mir.numeric? Disclaimer: I'm also not a lawyer. At least in the US, what matters is not the copyright but the license. You aut

Re: Copyright for reworked Phobos code in Mir

2018-12-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 12/26/18 10:40 AM, 9il wrote: Hi folks, I am slightly confused by copyright mess in some of Mir modules. As you may know, some of them contain reworked Phobos functions. Plus I am not sure that I understand the meaning of Copyright in the context that both Phobos and Mir are Boost licensed

Copyright for reworked Phobos code in Mir

2018-12-26 Thread 9il via Digitalmars-d-learn
Hi folks, I am slightly confused by copyright mess in some of Mir modules. As you may know, some of them contain reworked Phobos functions. Plus I am not sure that I understand the meaning of Copyright in the context that both Phobos and Mir are Boost licensed. For example, currently, I am c

Re: Is there any working SQLite driver for windows?

2018-12-26 Thread Suliman via Digitalmars-d-learn
On Wednesday, 26 December 2018 at 12:13:27 UTC, Suliman wrote: On Wednesday, 26 December 2018 at 11:06:02 UTC, Andre Pany wrote: On Wednesday, 26 December 2018 at 08:19:03 UTC, Suliman wrote: Yesterday I tried several sqlite drivers and all of them have some issue that make it's build on Window

Re: D1 question: does anyone has bud (build) tool available for download?

2018-12-26 Thread jicman via Digitalmars-d-learn
On Friday, 21 December 2018 at 19:37:00 UTC, Steven Schveighoffer wrote: On 12/21/18 8:25 AM, jicman wrote: There used to be a tool called 'build', later named 'bud', that would build applications.  Does anyone know where I can download it?  I tried the old spot, dsource, http://www.dsource.o

Re: D1 question: does anyone has bud (build) tool available for download?

2018-12-26 Thread jicman via Digitalmars-d-learn
On Friday, 21 December 2018 at 19:29:25 UTC, bauss wrote: On Friday, 21 December 2018 at 13:25:17 UTC, jicman wrote: There used to be a tool called 'build', later named 'bud', that would build applications. Does anyone know where I can download it? I tried the old spot, dsource, http://www.

Re: Is there any working SQLite driver for windows?

2018-12-26 Thread Suliman via Digitalmars-d-learn
On Wednesday, 26 December 2018 at 11:06:02 UTC, Andre Pany wrote: On Wednesday, 26 December 2018 at 08:19:03 UTC, Suliman wrote: Yesterday I tried several sqlite drivers and all of them have some issue that make it's build on Windows impossible. Few examples https://github.com/huntlabs/hunt-d

Re: Is there any working SQLite driver for windows?

2018-12-26 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 26 December 2018 at 08:19:03 UTC, Suliman wrote: Yesterday I tried several sqlite drivers and all of them have some issue that make it's build on Windows impossible. Few examples https://github.com/huntlabs/hunt-database/issues/24 https://github.com/biozic/d2sqlite3/issues/51 Y

Re: Handling signals in D

2018-12-26 Thread Basile B via Digitalmars-d-learn
On Wednesday, 26 December 2018 at 03:19:45 UTC, Norbert Preining wrote: Hello everyone, we are writing a program that synchronizes the OneDrive cloud service with the local computer, and run it as daemon in the background. To ensure proper database shutdown on exit, we need to install signal h

Is there any working SQLite driver for windows?

2018-12-26 Thread Suliman via Digitalmars-d-learn
Yesterday I tried several sqlite drivers and all of them have some issue that make it's build on Windows impossible. Few examples https://github.com/huntlabs/hunt-database/issues/24 https://github.com/biozic/d2sqlite3/issues/51