Re: code.dlang.org: 500 - Internal Server Error

2018-03-15 Thread Seb via Digitalmars-d
On Friday, 16 March 2018 at 05:24:25 UTC, Andre Pany wrote: Hi, while searching, there is an internal server error raised: http://code.dlang.org/search?q=d-unit 500 - Internal Server Error Internal Server Error Internal error information: vibe.db.mongo.connection.MongoDriverException@../vibe.

code.dlang.org: 500 - Internal Server Error

2018-03-15 Thread Andre Pany via Digitalmars-d
Hi, while searching, there is an internal server error raised: http://code.dlang.org/search?q=d-unit 500 - Internal Server Error Internal Server Error Internal error information: vibe.db.mongo.connection.MongoDriverException@../vibe.d/mongodb/vibe/db/mongo/cursor.d(304): Query failed. Does th

Re: Unreachable warning is annoying

2018-03-15 Thread Ali Çehreli via Digitalmars-d
On 03/15/2018 04:27 PM, Steven Schveighoffer wrote: Note, I replied with the following text, but for some reason the forum does NOT see this post. It should be here: https://forum.dlang.org/post/p8990d$2ona$1...@digitalmars.com And it does exist on the NNTP server. It was received by Thunde

Re: Unreachable warning is annoying

2018-03-15 Thread Steven Schveighoffer via Digitalmars-d
On 3/13/18 3:21 PM, Timon Gehr wrote: On 13.03.2018 18:43, H. S. Teoh wrote: On Tue, Mar 13, 2018 at 01:32:55PM -0400, Steven Schveighoffer via Digitalmars-d wrote: [...] An unrolled foreach on a tuple has a notion that the flow control jumps out of the loop, and it's OK to skip further loops

Re: dmd -unittest= (same syntax as -i)

2018-03-15 Thread Jonathan Marler via Digitalmars-d
On Thursday, 15 March 2018 at 23:11:41 UTC, Johannes Pfau wrote: Am Wed, 14 Mar 2018 14:22:01 -0700 schrieb Timothee Cour: [...] And then we'll have to add yet another "-import" switch for DLL support. Now we have 3 switches doing essentially the same: Telling the compiler which modules are

Re: dmd -unittest= (same syntax as -i)

2018-03-15 Thread Johannes Pfau via Digitalmars-d
Am Wed, 14 Mar 2018 14:22:01 -0700 schrieb Timothee Cour: > would a PR for `dmd -unittest= (same syntax as -i)` be welcome? > wouldn't that avoid all the complicatiosn with version(StdUnittest) ? > eg use case: > > # compile with unittests just for package foo (excluding subpackage > foo.bar) > d

Re: dmd -unittest= (same syntax as -i)

2018-03-15 Thread Jonathan Marler via Digitalmars-d
On Thursday, 15 March 2018 at 12:14:12 UTC, Jacob Carlborg wrote: On Thursday, 15 March 2018 at 05:22:45 UTC, Seb wrote: Hmm how would this solve the StdUnittest use case? I.e. that templated phobos unittests and private unittest symbols are compiled into the users unittests? See also: http

Re: DConf 2018 - The touristy bits

2018-03-15 Thread Walter Bright via Digitalmars-d
On 3/15/2018 4:33 AM, Chris wrote: For sight-seeing, I'd recommend the CityTourCard: https://www.mvv-muenchen.de/en/tickets-and-fares/tickets-daytickets/citytourcard/index.html#c12632 Does the "entire network" price include the airport?

Re: Linux signal handling - notifying a condition variable

2018-03-15 Thread Patrick Schluter via Digitalmars-d
On Thursday, 15 March 2018 at 16:51:59 UTC, Jim King wrote: I am trying to add graceful shutdown support to a test harness. In the test harness, a server class consumes a thread to accept connections and service them. In order to stop the server, it has to be interrupted. This interruption m

Re: Linux signal handling - notifying a condition variable

2018-03-15 Thread Dmitry Olshansky via Digitalmars-d
On Thursday, 15 March 2018 at 19:36:44 UTC, Patrick Schluter wrote: On Thursday, 15 March 2018 at 19:23:26 UTC, Dmitry Olshansky wrote: On Thursday, 15 March 2018 at 17:30:50 UTC, Jim King wrote: [...] Another option if you are on linux is to use eventfd. Then you can trigger it with simple

Re: Linux signal handling - notifying a condition variable

2018-03-15 Thread Patrick Schluter via Digitalmars-d
On Thursday, 15 March 2018 at 19:23:26 UTC, Dmitry Olshansky wrote: On Thursday, 15 March 2018 at 17:30:50 UTC, Jim King wrote: [...] Another option if you are on linux is to use eventfd. Then you can trigger it with simple write on eventfd descriptor. As far as waiting goes it’s either rea

Re: Linux signal handling - notifying a condition variable

2018-03-15 Thread Dmitry Olshansky via Digitalmars-d
On Thursday, 15 March 2018 at 17:30:50 UTC, Jim King wrote: On Thursday, 15 March 2018 at 17:12:24 UTC, Adam D. Ruppe wrote: On Thursday, 15 March 2018 at 16:51:59 UTC, Jim King wrote: In going through the signal documentation it looks like the signal handler must be a "nothrow @nogc" variety.

Re: Linux signal handling - notifying a condition variable

2018-03-15 Thread Adam D. Ruppe via Digitalmars-d
Alternatively btw you can use the pthreads C functions import core.sys.posix.pthread; which shuld also be nogc right now. The condition class wraps those on Linux fairly thinly; using the C functions should be little more trouble.

Re: Linux signal handling - notifying a condition variable

2018-03-15 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 15 March 2018 at 17:30:50 UTC, Jim King wrote: The problem with that is that it requires a busy loop to detect it. well, what's your thread doing? In the case I used this pattern, it was blocking on a call to select() anyway, so when it returned with EINTR, that was a good opport

Re: dmd -unittest= (same syntax as -i)

2018-03-15 Thread Nordlöw via Digitalmars-d
On Wednesday, 14 March 2018 at 21:22:01 UTC, Timothee Cour wrote: would a PR for `dmd -unittest= (same syntax as -i)` be welcome? wouldn't that avoid all the complicatiosn with version(StdUnittest) ? eg use case: # compile with unittests just for package foo (excluding subpackage foo.bar) dmd

Re: Linux signal handling - notifying a condition variable

2018-03-15 Thread Jim King via Digitalmars-d
On Thursday, 15 March 2018 at 17:12:24 UTC, Adam D. Ruppe wrote: On Thursday, 15 March 2018 at 16:51:59 UTC, Jim King wrote: In going through the signal documentation it looks like the signal handler must be a "nothrow @nogc" variety. Looks like notify actually can throw an exception... the wa

Re: Linux signal handling - notifying a condition variable

2018-03-15 Thread Adam D. Ruppe via Digitalmars-d
On Thursday, 15 March 2018 at 16:51:59 UTC, Jim King wrote: In going through the signal documentation it looks like the signal handler must be a "nothrow @nogc" variety. Looks like notify actually can throw an exception... the way I usually do signal handlers is just set a global variable: _

Linux signal handling - notifying a condition variable

2018-03-15 Thread Jim King via Digitalmars-d
I am trying to add graceful shutdown support to a test harness. In the test harness, a server class consumes a thread to accept connections and service them. In order to stop the server, it has to be interrupted. This interruption mechanism is based on core.sync.condition. I want to add a

Re: Tuple DIP

2018-03-15 Thread Timon Gehr via Digitalmars-d
On 15.03.2018 14:42, Nick Treleaven wrote: On Wednesday, 17 January 2018 at 06:44:21 UTC, Timon Gehr wrote: It uses tuples because it uses zip. The code does not compile today, because the lambda I'm passing to "map" has two parameters: auto a = [1, 2, 4, 7, 2]; auto b = [3, 5, 3, 2, 4]; // a

Re: Tuple DIP

2018-03-15 Thread Timon Gehr via Digitalmars-d
On 15.03.2018 11:45, ixid wrote: On Friday, 12 January 2018 at 22:44:48 UTC, Timon Gehr wrote: auto (a, b) = (1, 2); For the assignment and unpacking grammar why not adopt [...] Go syntax? ... It does not fit in. auto a, b = 1, 2; // Creates two new variables with the values 1 and 2 auto c

Re: dmd -unittest= (same syntax as -i)

2018-03-15 Thread Steven Schveighoffer via Digitalmars-d
On 3/14/18 5:22 PM, Timothee Cour wrote: would a PR for `dmd -unittest= (same syntax as -i)` be welcome? wouldn't that avoid all the complicatiosn with version(StdUnittest) ? eg use case: # compile with unittests just for package foo (excluding subpackage foo.bar) dmd -unittest=foo -unittest=-fo

Re: Do we need Mat, Vec, TMmat, Diag, Sym and other matrix types?

2018-03-15 Thread jmh530 via Digitalmars-d
On Thursday, 15 March 2018 at 05:04:42 UTC, 9il wrote: [snip] BTW, could you please help with the following issue?! struct S(int b, T) { } alias V(T) = S!(1, T); auto foo (T)(V!T v) { } void main() { V!double v; foo(v); } Error: template onlineapp.foo cannot deduce function from ar

Re: Tuple DIP

2018-03-15 Thread Seb via Digitalmars-d
On Thursday, 15 March 2018 at 14:11:47 UTC, Stefan Koch wrote: On Thursday, 15 March 2018 at 14:07:12 UTC, JN wrote: On Friday, 12 January 2018 at 22:44:48 UTC, Timon Gehr wrote: As promised [1], I have started setting up a DIP to improve tuple ergonomics in D: https://github.com/tgehr/DIPs/b

Re: dmd -unittest= (same syntax as -i)

2018-03-15 Thread Seb via Digitalmars-d
On Thursday, 15 March 2018 at 12:14:12 UTC, Jacob Carlborg wrote: On Thursday, 15 March 2018 at 05:22:45 UTC, Seb wrote: Hmm how would this solve the StdUnittest use case? I.e. that templated phobos unittests and private unittest symbols are compiled into the users unittests? See also: http

Re: dmd -unittest= (same syntax as -i)

2018-03-15 Thread Jonathan M Davis via Digitalmars-d
On Thursday, March 15, 2018 07:17:47 H. S. Teoh via Digitalmars-d wrote: > On Thu, Mar 15, 2018 at 12:14:12PM +, Jacob Carlborg via Digitalmars-d wrote: > > On Thursday, 15 March 2018 at 05:22:45 UTC, Seb wrote: > > > Hmm how would this solve the StdUnittest use case? I.e. that > > > templated

Re: dmd -unittest= (same syntax as -i)

2018-03-15 Thread H. S. Teoh via Digitalmars-d
On Thu, Mar 15, 2018 at 12:14:12PM +, Jacob Carlborg via Digitalmars-d wrote: > On Thursday, 15 March 2018 at 05:22:45 UTC, Seb wrote: > > > Hmm how would this solve the StdUnittest use case? I.e. that > > templated phobos unittests and private unittest symbols are compiled > > into the users

Re: Do we need Mat, Vec, TMmat, Diag, Sym and other matrix types?

2018-03-15 Thread jmh530 via Digitalmars-d
On Thursday, 15 March 2018 at 12:49:22 UTC, jmh530 wrote: [snip] It looks like it should expand the alias earlier. No problem with auto foo (T)(S!(1, T) v) {}; Also, this issue also shows up in mir.ndslice.traits. I had to do the equivalent of isV below. It doesn't work to do the alternate

Re: Tuple DIP

2018-03-15 Thread Stefan Koch via Digitalmars-d
On Thursday, 15 March 2018 at 14:07:12 UTC, JN wrote: On Friday, 12 January 2018 at 22:44:48 UTC, Timon Gehr wrote: As promised [1], I have started setting up a DIP to improve tuple ergonomics in D: https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md I may be out of the loop h

Re: core.math and std.math

2018-03-15 Thread Atila Neves via Digitalmars-d
On Thursday, 15 March 2018 at 02:58:12 UTC, Nicholas Wilson wrote: On Thursday, 15 March 2018 at 00:37:39 UTC, jmh530 wrote: On Thursday, 15 March 2018 at 00:16:05 UTC, Manu wrote: Why does core.math exist? It's basically empty, but with a couple of select functions which seem arbitrarily chose

Re: Tuple DIP

2018-03-15 Thread JN via Digitalmars-d
On Friday, 12 January 2018 at 22:44:48 UTC, Timon Gehr wrote: As promised [1], I have started setting up a DIP to improve tuple ergonomics in D: https://github.com/tgehr/DIPs/blob/tuple-syntax/DIPs/DIP1xxx-tg.md I may be out of the loop here, but what is the actual usecase for tuples? What b

Re: Tuple DIP

2018-03-15 Thread Nick Treleaven via Digitalmars-d
On Wednesday, 17 January 2018 at 06:44:21 UTC, Timon Gehr wrote: It uses tuples because it uses zip. The code does not compile today, because the lambda I'm passing to "map" has two parameters: auto a = [1, 2, 4, 7, 2]; auto b = [3, 5, 3, 2, 4]; // auto c = zip(a, b).map!((x, y) => x + y); //

Re: Do we need Mat, Vec, TMmat, Diag, Sym and other matrix types?

2018-03-15 Thread jmh530 via Digitalmars-d
On Thursday, 15 March 2018 at 05:04:42 UTC, 9il wrote: [snip] BTW, could you please help with the following issue?! struct S(int b, T) { } alias V(T) = S!(1, T); auto foo (T)(V!T v) { } void main() { V!double v; foo(v); } Error: template onlineapp.foo cannot deduce function from arg

Re: dmd -unittest= (same syntax as -i)

2018-03-15 Thread Jacob Carlborg via Digitalmars-d
On Thursday, 15 March 2018 at 05:22:45 UTC, Seb wrote: Hmm how would this solve the StdUnittest use case? I.e. that templated phobos unittests and private unittest symbols are compiled into the users unittests? See also: https://github.com/dlang/phobos/pull/6202 https://github.com/dlang/phob

Re: DConf 2018 - The touristy bits

2018-03-15 Thread Chris via Digitalmars-d
On Thursday, 15 March 2018 at 11:23:57 UTC, Chris wrote: On Wednesday, 14 March 2018 at 23:54:53 UTC, Walter Bright wrote: On 3/13/2018 4:19 AM, Chris wrote: I will probably not be able to make it to DConf this year. But here are some tips for those who are interested in history and / or sight

Re: DConf 2018 - The touristy bits

2018-03-15 Thread Chris via Digitalmars-d
On Wednesday, 14 March 2018 at 23:54:53 UTC, Walter Bright wrote: On 3/13/2018 4:19 AM, Chris wrote: I will probably not be able to make it to DConf this year. But here are some tips for those who are interested in history and / or sight-seeing: Thank you, most appreciated! You're welcome.

Re: Tuple DIP

2018-03-15 Thread ixid via Digitalmars-d
On Friday, 12 January 2018 at 22:44:48 UTC, Timon Gehr wrote: auto (a, b) = (1, 2); For the assignment and unpacking grammar why not adopt the more streamlined Go syntax? auto a, b = 1, 2; // Creates two new variables with the values 1 and 2 auto c, d = 1, (2,3); // A normal variable and a

Re: Confusing TLS

2018-03-15 Thread Jacob Carlborg via Digitalmars-d
On Tuesday, 13 March 2018 at 22:34:32 UTC, Jack Applegame wrote: Code: import std.stdio; import core.thread; import core.time; auto arr = new ubyte[1]; // THIS SHOULD NOT COMPILE int main(string[] args) { new Thread({ arr[0]++; }).start(); new Thread({ arr[0]++;