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:

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

[Issue 18444] [DIP25][DIP1000] Tracking issue for: "The implementation doesn't match DIPs 25/1000"

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18444 Issue 18444 depends on issue 17512, which changed state. Issue 17512 Summary: [REG 2.073] [DIP1000] Error on bad interplay of 'auto ref' and 'return' attribute deduction. https://issues.dlang.org/show_bug.cgi?id=17512 What|Removed

[Issue 18530] [Reg 2.079] src/rt/tracegc.d(43): Deprecation: The delete keyword has been deprecated

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18530 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/95e86e960f6c93875c5a3b16f5edff343997290e fix Issue 18530 - src/rt/tracegc.d(43): Deprecation: The

[Issue 17512] [REG 2.073] [DIP1000] Error on bad interplay of 'auto ref' and 'return' attribute deduction.

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17512 --- Comment #6 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/56b770c60cb301b46a287e201fb4934f6551414b fix Issue 17512 - [REG 2.073] [DIP1000] Error on bad

[Issue 18530] [Reg 2.079] src/rt/tracegc.d(43): Deprecation: The delete keyword has been deprecated

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18530 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: Seeking lecturer - D language (Moscow)

2018-03-15 Thread Dmitry Olshansky via Digitalmars-d-announce
On Friday, 16 March 2018 at 00:18:20 UTC, Ivan Kazmenko wrote: On Wednesday, 14 March 2018 at 11:38:20 UTC, Dmitry Olshansky wrote: At the moment it’s a bit early stage but we are looking for enthusiast who has spare time and desire to spread the knowledge of D supremacy among students. The

[Issue 18282] [Scope][DIP1000]Assignment of local variable to `scope` variable not recognized by compiler

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18282 github-bugzi...@puremagic.com changed: What|Removed |Added Status|REOPENED|RESOLVED

[Issue 18282] [Scope][DIP1000]Assignment of local variable to `scope` variable not recognized by compiler

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18282 --- Comment #5 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/ac0224287fd16d293081059acef7c23b94212a7b fix Issue 18282 - [Scope][DIP1000]Assignment of local

[Issue 18484] [dip1000] Subtype allows reference to escape with implicit casting

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18484 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/ff6edd1f56da1604d0b22d5342c5100633551cce fix Issue 18484 - [dip1000] Subtype allows reference to

[Issue 18484] [dip1000] Subtype allows reference to escape with implicit casting

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18484 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

Re: Vision document for H1 2018

2018-03-15 Thread psychoticRabbit via Digitalmars-d-announce
On Thursday, 15 March 2018 at 18:39:08 UTC, rumbu wrote: My quote is out of context. Somebody asked surprised why C# developers are interested in D. For me (mainly a C# developer), this is the main reason: native compilation (and this includes memory management). I highlighted the fact that

Re: Seeking lecturer - D language (Moscow)

2018-03-15 Thread Ivan Kazmenko via Digitalmars-d-announce
On Wednesday, 14 March 2018 at 11:38:20 UTC, Dmitry Olshansky wrote: At the moment it’s a bit early stage but we are looking for enthusiast who has spare time and desire to spread the knowledge of D supremacy among students. The course will replace an equivalent of 1 year C++ course, but may

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

Re: Allocator Part of Type

2018-03-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/15/18 6:30 PM, jmh530 wrote: On Thursday, 15 March 2018 at 21:43:41 UTC, Steven Schveighoffer wrote: [snip] I don't know if I've heard Andrei talk about that, but I definitely have made it part of the type for types that need to allocate. The only other possibility is to accept and use

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: Efficient way to pass struct as parameter

2018-03-15 Thread Cecil Ward via Digitalmars-d-learn
On Thursday, 15 March 2018 at 23:15:47 UTC, Cecil Ward wrote: On Thursday, 15 March 2018 at 23:14:14 UTC, Cecil Ward wrote: On Tuesday, 2 January 2018 at 18:21:13 UTC, Tim Hsu wrote: [...] U or even 'I' will be delighted to take a look. Also link time optimisation and whole program

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

Re: Efficient way to pass struct as parameter

2018-03-15 Thread Cecil Ward via Digitalmars-d-learn
On Thursday, 15 March 2018 at 23:14:14 UTC, Cecil Ward wrote: On Tuesday, 2 January 2018 at 18:21:13 UTC, Tim Hsu wrote: [...] U or even 'I' will be delighted to take a look.

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) >

Re: Efficient way to pass struct as parameter

2018-03-15 Thread Cecil Ward via Digitalmars-d-learn
On Tuesday, 2 January 2018 at 18:21:13 UTC, Tim Hsu wrote: I am creating Vector3 structure. I use struct to avoid GC. However, struct will be copied when passed as parameter to function struct Ray { Vector3f origin; Vector3f dir; @nogc @system this(Vector3f *origin, Vector3f

Re: signbit question

2018-03-15 Thread ketmar via Digitalmars-d-learn
Miguel L wrote: as the calculations on f guarantee it cannot be 0 at all. than `f` will become zero very soon. something that "cannot happen" is the most probable thing to happen. otherwise, LGTM.

Re: Readonly field for class type

2018-03-15 Thread Ali Çehreli via Digitalmars-d-learn
On 03/15/2018 03:16 AM, Andrey wrote: Hello, is there way to declare read only field for class type with ability to call inner non constant methods? i.e.: class A {     int value = 12;     void updateValue() {     value = 13;     } } class B {     const A a;     this() {     a = new

Re: Allocator Part of Type

2018-03-15 Thread jmh530 via Digitalmars-d-learn
On Thursday, 15 March 2018 at 21:43:41 UTC, Steven Schveighoffer wrote: [snip] I don't know if I've heard Andrei talk about that, but I definitely have made it part of the type for types that need to allocate. The only other possibility is to accept and use an Allocator object (i.e. the

Re: Function argument that is a pointer to memory which the function is not allowed to modify, as in C const

2018-03-15 Thread Cecil Ward via Digitalmars-d-learn
On Wednesday, 14 March 2018 at 22:23:47 UTC, Cecil Ward wrote: say in C I have a function with a pointer argument foo( const sometype_t * p ) [...] That's the secret - I didn't know about the const (T) * thing - I would never have discovered that ! Many thanks, the missing piece to the

[Issue 18136] ICE in dmd/statement.d(426)

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18136 greenify changed: What|Removed |Added CC||greeen...@gmail.com ---

Re: Vision document for H1 2018

2018-03-15 Thread rumbu via Digitalmars-d-announce
On Thursday, 15 March 2018 at 21:10:47 UTC, flamencofantasy wrote: On Wednesday, 14 March 2018 at 05:22:53 UTC, rumbu wrote: I doubt that this was the blocker because C# had ArraySegment since .net framework 2.0 (2006), which is exactly a slice, but doesn't have the syntactic sugar for it.

Re: Allocator Part of Type

2018-03-15 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/15/18 3:36 PM, jmh530 wrote: I recall some talk Andrei did where he said it was a bad idea to make the allocator part of the type.  However, the container library in dlang-community(says it is backed with std.experimental.allocator) contains allocator as part of the type. Automem does

[Issue 18620] New: `error cannot be interpreted at compile time` is missing context where error occurs

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18620 Issue ID: 18620 Summary: `error cannot be interpreted at compile time` is missing context where error occurs Product: D Version: D2 Hardware: x86 OS: All

[Issue 18445] [DIP25][DIP1000] Wrong "return as a parameter attribute" inference

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18445 Carsten Blüggel changed: What|Removed |Added Summary|[DIP25] |[DIP25][DIP1000] Wrong

Re: Vision document for H1 2018

2018-03-15 Thread flamencofantasy via Digitalmars-d-announce
On Wednesday, 14 March 2018 at 05:22:53 UTC, rumbu wrote: I doubt that this was the blocker because C# had ArraySegment since .net framework 2.0 (2006), which is exactly a slice, but doesn't have the syntactic sugar for it. If it doesn't have the syntactic sugar how is it "exactly a slice"?

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:

Re: Error: cannot implicitly convert expression this.aa of type inout(string[string]) to string[string]

2018-03-15 Thread Simen Kjærås via Digitalmars-d-learn
On Thursday, 15 March 2018 at 15:41:54 UTC, Robert-D wrote: Why something like this doesn't compile (with or without the cast on bb.dup)? struct S { string[string] aa; S dup() inout pure { return S(cast(string[string]) aa.dup); } } struct SS { S[] bb; SS dup()

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

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

Allocator Part of Type

2018-03-15 Thread jmh530 via Digitalmars-d-learn
I recall some talk Andrei did where he said it was a bad idea to make the allocator part of the type. However, the container library in dlang-community(says it is backed with std.experimental.allocator) contains allocator as part of the type. Automem does too. Honestly, I would think you

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

Re: Networking library

2018-03-15 Thread Dmitry Olshansky via Digitalmars-d-learn
On Thursday, 15 March 2018 at 00:06:49 UTC, Cecil Ward wrote: Can anyone point me in the direction of a library that provides very very lightweight (minimum overhead) asynchronous i/o routines for - shopping list 1. sending and receiving IPv4 / IPv6 packets, 2. sending receiving ICMP and 3,

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: Ecoji-d v1.0.0 is released - Base1024 using emojis 

2018-03-15 Thread Anton Fediushin via Digitalmars-d-announce
On Thursday, 15 March 2018 at 09:32:50 UTC, bauss wrote: Fun, but seems pretty useless in practice. I disagree. Ecoji (base1024) has bigger character set meaning that it can encode more information per emoji than base64 can encode per character. For example ecoji encoded "abcde" looks like

Re: What is the "right" way to create a generic type getter (and setter) ?

2018-03-15 Thread Cym13 via Digitalmars-d-learn
On Thursday, 15 March 2018 at 15:48:52 UTC, James Blachly wrote: On Wednesday, 14 March 2018 at 22:58:25 UTC, ag0aep6g wrote: You can probably get around the (manually maintained?) `FIELDS` array with `.tupleof` or something similar: static foreach (i, f; S.tupleof) { case

Re: Vision document for H1 2018

2018-03-15 Thread rumbu via Digitalmars-d-announce
On Thursday, 15 March 2018 at 17:17:47 UTC, Dukc wrote: On Sunday, 11 March 2018 at 07:59:53 UTC, rumbu wrote: My opinion is that the day when C# will compile to native (on any platform), the C# developer interest in D will drop instantly. I do write a commerical project in C#. But I have an

Re: signbit question

2018-03-15 Thread Dlang User via Digitalmars-d-learn
On 3/15/2018 12:39 PM, Miguel L wrote: On Thursday, 15 March 2018 at 17:31:38 UTC, rumbu wrote: On Thursday, 15 March 2018 at 17:18:08 UTC, Miguel L wrote: On Thursday, 15 March 2018 at 16:31:56 UTC, Stefan Koch wrote: On Thursday, 15 March 2018 at 15:28:16 UTC, Miguel L wrote: [...]

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

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)

Re: signbit question

2018-03-15 Thread Miguel L via Digitalmars-d-learn
On Thursday, 15 March 2018 at 17:31:38 UTC, rumbu wrote: On Thursday, 15 March 2018 at 17:18:08 UTC, Miguel L wrote: On Thursday, 15 March 2018 at 16:31:56 UTC, Stefan Koch wrote: On Thursday, 15 March 2018 at 15:28:16 UTC, Miguel L wrote: [...] integers don't have a sign-bit. since they

Re: signbit question

2018-03-15 Thread rumbu via Digitalmars-d-learn
On Thursday, 15 March 2018 at 17:18:08 UTC, Miguel L wrote: On Thursday, 15 March 2018 at 16:31:56 UTC, Stefan Koch wrote: On Thursday, 15 March 2018 at 15:28:16 UTC, Miguel L wrote: Why does std.math.signbit only work for floating point types? Is there an analogue function for integer types?

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

Re: signbit question

2018-03-15 Thread Seb via Digitalmars-d-learn
On Thursday, 15 March 2018 at 16:31:56 UTC, Stefan Koch wrote: On Thursday, 15 March 2018 at 15:28:16 UTC, Miguel L wrote: Why does std.math.signbit only work for floating point types? Is there an analogue function for integer types? what is the best way to compare the sign of a float with the

Re: Vision document for H1 2018

2018-03-15 Thread Dukc via Digitalmars-d-announce
On Sunday, 11 March 2018 at 07:59:53 UTC, rumbu wrote: My opinion is that the day when C# will compile to native (on any platform), the C# developer interest in D will drop instantly. I do write a commerical project in C#. But I have an opposite feeling: The day D will easily compile to

Re: signbit question

2018-03-15 Thread Miguel L via Digitalmars-d-learn
On Thursday, 15 March 2018 at 16:31:56 UTC, Stefan Koch wrote: On Thursday, 15 March 2018 at 15:28:16 UTC, Miguel L wrote: Why does std.math.signbit only work for floating point types? Is there an analogue function for integer types? what is the best way to compare the sign of a float with the

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:

Re: The D Language Foundation at Open Collective

2018-03-15 Thread Ola Fosheim Grøstad via Digitalmars-d-announce
On Thursday, 15 March 2018 at 17:06:00 UTC, Ola Fosheim Grøstad wrote: On Thursday, 15 March 2018 at 14:13:10 UTC, Mike Parker wrote: At the current exchange rate, a venti-sized cup of drip coffee at Starbucks in Korea is $4.51. When I go to GA, it's cheaper. A venti Americano is $4.79. But I

Re: The D Language Foundation at Open Collective

2018-03-15 Thread Ola Fosheim Grøstad via Digitalmars-d-announce
On Thursday, 15 March 2018 at 14:13:10 UTC, Mike Parker wrote: At the current exchange rate, a venti-sized cup of drip coffee at Starbucks in Korea is $4.51. When I go to GA, it's cheaper. A venti Americano is $4.79. But I think when people talk about $5 coffees, they're referring to lattes

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

[Issue 18172] std.getopt should allow taking parameters by `ref` (like std.format.formattedRead), s.t. it can be used in @safe

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18172 --- Comment #9 from Seb --- > then I get linker errors about stuff in std.conv being undefined, but there > are no more errors from the compiler itself. I think that that happens > sometimes when some code is compiled with

Re: signbit question

2018-03-15 Thread Stefan Koch via Digitalmars-d-learn
On Thursday, 15 March 2018 at 15:28:16 UTC, Miguel L wrote: Why does std.math.signbit only work for floating point types? Is there an analogue function for integer types? what is the best way to compare the sign of a float with the sign of an integer? Thanks in advance integers don't have a

Re: signbit question

2018-03-15 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 15 March 2018 at 15:28:16 UTC, Miguel L wrote: Why does std.math.signbit only work for floating point types? Integers are stored in an entirely different way, twos-complement instead of having a sign bit. You probably shouldn't be using the sign bit function at all, it is for

[Issue 18172] std.getopt should allow taking parameters by `ref` (like std.format.formattedRead), s.t. it can be used in @safe

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18172 --- Comment #8 from Jonathan M Davis --- (In reply to Jack Stouffer from comment #7) > I should have emphized more the fact that I had already modified getopt. > I've attached my changes as a patch Without compiling

Re: signbit question

2018-03-15 Thread Seb via Digitalmars-d-learn
On Thursday, 15 March 2018 at 15:28:16 UTC, Miguel L wrote: Why does std.math.signbit only work for floating point types? Is there an analogue function for integer types? I guess because for integers you don't need to distinguish between +0.0 and -0.0, so no one bother until now to add it to

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]; //

Re: OT: Coffee prices [was Re: The D Language Foundation at Open Collective]

2018-03-15 Thread Meta via Digitalmars-d-announce
On Thursday, 15 March 2018 at 13:10:57 UTC, Seb wrote: (though in Germany that's often cheaper than one cup of coffee) On second thought, maybe I'll move to Germany. I'll suffer expensive coffee in exchange for cheap beer ;-)

Re: Vision document for H1 2018

2018-03-15 Thread rumbu via Digitalmars-d-announce
On Thursday, 15 March 2018 at 12:23:19 UTC, Kagamin wrote: No, FWIW phobos uses more or less the same programming solutions as .net framework, the claim that they are different is an uninformed opinion. Are you sure that you are talking about phobos and not tango? :) I'm eager to find how

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

[Issue 18282] [Scope][DIP1000]Assignment of local variable to `scope` variable not recognized by compiler

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18282 Carsten Blüggel changed: What|Removed |Added CC||chi...@posteo.net --

[Issue 18596] std.random.unpredictableSeed could use something better than MinstdRand0

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18596 --- Comment #1 from Nathan S. --- Pull request https://github.com/dlang/phobos/pull/6267 --

[Issue 18478] Spurious "escapes a reference to local variable" error in function that does not return by reference

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18478 Carsten Blüggel changed: What|Removed |Added CC||chi...@posteo.net --

[Issue 18484] [dip1000] Subtype allows reference to escape with implicit casting

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18484 Carsten Blüggel changed: What|Removed |Added CC||chi...@posteo.net --

Re: What is the "right" way to create a generic type getter (and setter) ?

2018-03-15 Thread James Blachly via Digitalmars-d-learn
On Wednesday, 14 March 2018 at 22:58:25 UTC, ag0aep6g wrote: You can probably get around the (manually maintained?) `FIELDS` array with `.tupleof` or something similar: static foreach (i, f; S.tupleof) { case __traits(identifier, f): } Any pointers / design patterns on this

Re: Error: cannot implicitly convert expression this.aa of type inout(string[string]) to string[string]

2018-03-15 Thread Robert-D via Digitalmars-d-learn
On Thursday, 15 March 2018 at 13:18:38 UTC, Simen Kjærås wrote: On Thursday, 15 March 2018 at 12:00:08 UTC, Robert-D wrote: I want the function to create a mutable copy from a const or a imutable Like this: void main() { const S s = S(["": ""]); S b = s.dup(); } How can i do that?

signbit question

2018-03-15 Thread Miguel L via Digitalmars-d-learn
Why does std.math.signbit only work for floating point types? Is there an analogue function for integer types? what is the best way to compare the sign of a float with the sign of an integer? Thanks in advance

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

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

[Issue 18174] std.math.equalsDigit should be usable in @safe

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18174 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 18110] most of phobos should be @safe-ly useable

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18110 Issue 18110 depends on issue 18174, which changed state. Issue 18174 Summary: std.math.equalsDigit should be usable in @safe https://issues.dlang.org/show_bug.cgi?id=18174 What|Removed |Added

[Issue 18174] std.math.equalsDigit should be usable in @safe

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18174 --- Comment #1 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/a4d98d0e9091a24276d12a3914217e05fcb0b584 Fix Issue 18174 - std.math.equalsDigit should be usable

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:

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:

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 > > >

[Issue 18172] std.getopt should allow taking parameters by `ref` (like std.format.formattedRead), s.t. it can be used in @safe

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18172 --- Comment #7 from Jack Stouffer --- (In reply to Jonathan M Davis from comment #5) > You have to compile with -dip1000, which Phobos isn't right now. If I try it > locally with -dip1000, I get > > q.d(10): Error: scope

[Issue 18172] std.getopt should allow taking parameters by `ref` (like std.format.formattedRead), s.t. it can be used in @safe

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18172 Jack Stouffer changed: What|Removed |Added Attachment #1683|application/mbox|text/plain

[Issue 18172] std.getopt should allow taking parameters by `ref` (like std.format.formattedRead), s.t. it can be used in @safe

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18172 --- Comment #6 from Jack Stouffer --- Created attachment 1683 --> https://issues.dlang.org/attachment.cgi?id=1683=edit getopt.patch --

[Issue 18172] std.getopt should allow taking parameters by `ref` (like std.format.formattedRead), s.t. it can be used in @safe

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18172 --- Comment #5 from Jonathan M Davis --- You have to compile with -dip1000, which Phobos isn't right now. If I try it locally with -dip1000, I get q.d(10): Error: scope variable f assigned to non-scope parameter

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

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: The D Language Foundation at Open Collective

2018-03-15 Thread Mike Parker via Digitalmars-d-announce
On Thursday, 15 March 2018 at 12:36:24 UTC, Meta wrote: On Wednesday, 14 March 2018 at 12:00:42 UTC, Seb wrote: Yeah, the idea is that 5$ a month isn't much (~ one coffee in most countries), but if 500 people donate one coffee a month, you get the entire coffee machine with a warp engine :)

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

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

Re: Vibe.d web interface tutorial

2018-03-15 Thread Steven Schveighoffer via Digitalmars-d-announce
On 3/13/18 4:42 PM, aberba wrote: On Tuesday, 13 March 2018 at 10:12:24 UTC, Steven Schveighoffer wrote: On 3/9/18 11:34 AM, aberba wrote: http://aberba.com/2018/using-vibe-d-web-interface Very nice! Although this is missing one of my favorite vibe.d web interface features -- automatic

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

Re: Readonly field for class type

2018-03-15 Thread Seb via Digitalmars-d-learn
On Thursday, 15 March 2018 at 13:44:20 UTC, Seb wrote: On Thursday, 15 March 2018 at 10:57:52 UTC, Mike Parker wrote: On Thursday, 15 March 2018 at 10:55:16 UTC, Mike Parker wrote: class A { private int _value = 12; int value() @property { return _value; } void updateValue() {

Re: Readonly field for class type

2018-03-15 Thread Seb via Digitalmars-d-learn
On Thursday, 15 March 2018 at 13:44:20 UTC, Seb wrote: On Thursday, 15 March 2018 at 10:57:52 UTC, Mike Parker wrote: On Thursday, 15 March 2018 at 10:55:16 UTC, Mike Parker wrote: [...] Sorry. I overlooked that B.a is const. It still works, the `value` just needs to be `const` (or

Re: Readonly field for class type

2018-03-15 Thread Seb via Digitalmars-d-learn
On Thursday, 15 March 2018 at 10:57:52 UTC, Mike Parker wrote: On Thursday, 15 March 2018 at 10:55:16 UTC, Mike Parker wrote: class A { private int _value = 12; int value() @property { return _value; } void updateValue() { value = 13; } } ... auto a = new A(); writeln(a.value);

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: Error: cannot implicitly convert expression this.aa of type inout(string[string]) to string[string]

2018-03-15 Thread Simen Kjærås via Digitalmars-d-learn
On Thursday, 15 March 2018 at 12:00:08 UTC, Robert-D wrote: I want the function to create a mutable copy from a const or a imutable Like this: void main() { const S s = S(["": ""]); S b = s.dup(); } How can i do that? In that case, the problem is that you also have to .dup the aa:

OT: Coffee prices [was Re: The D Language Foundation at Open Collective]

2018-03-15 Thread Seb via Digitalmars-d-announce
On Thursday, 15 March 2018 at 12:36:24 UTC, Meta wrote: On Wednesday, 14 March 2018 at 12:00:42 UTC, Seb wrote: Yeah, the idea is that 5$ a month isn't much (~ one coffee in most countries), but if 500 people donate one coffee a month, you get the entire coffee machine with a warp engine :)

[Issue 18172] std.getopt should allow taking parameters by `ref` (like std.format.formattedRead), s.t. it can be used in @safe

2018-03-15 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18172 --- Comment #4 from Jack Stouffer --- (In reply to Jonathan M Davis from comment #3) > I'd suggest looking into how DIP 1000 can fix this problem without needing > ref, since with DIP 1000, taking the address of a local

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

  1   2   >