that is bug?

2018-04-07 Thread sdvcn via Digitalmars-d
string stt = "none"; true?writeln("AA"):writeln("BB"); ///Out:AA true?stt="AA":stt="BB";-///Out:BB writeln(stt);

Re: that is bug?

2018-04-07 Thread Jonathan M Davis via Digitalmars-d
On Saturday, April 07, 2018 09:07:48 sdvcn via Digitalmars-d wrote: > string stt = "none"; > true?writeln("AA"):writeln("BB"); ///Out:AA > true?stt="AA":stt="BB";-///Out:BB > writeln(stt); Assignment takes precendence over the ternary operator. So, no, I don't think th

Re: that is bug?

2018-04-07 Thread bauss via Digitalmars-d
On Saturday, 7 April 2018 at 09:07:48 UTC, sdvcn wrote: true?stt="AA":stt="BB";-///Out:BB It's an UB. Not a bug.

Re: Space before parens in all function definitions

2018-04-07 Thread Sönke Ludwig via Digitalmars-d
Am 07.04.2018 um 04:23 schrieb Andrei Alexandrescu: Why is there a space before "(" in our /library/ docs? https://dlang.org/library/std/stdio/file.tmpfile.html The paren here has role similar to that in mathematics, not literary. Thanks, Andrei Has been a regression during the diet-ng tra

Re: that is bug?

2018-04-07 Thread meppl via Digitalmars-d
On Saturday, 7 April 2018 at 10:25:19 UTC, bauss wrote: On Saturday, 7 April 2018 at 09:07:48 UTC, sdvcn wrote: true?stt="AA":stt="BB";-///Out:BB It's an UB. Not a bug. I want `condition ? expr1 : expr2` to behave like: - auto qc( alias condition, string expr1, st

Re: that is bug?

2018-04-07 Thread Seb via Digitalmars-d
On Saturday, 7 April 2018 at 11:19:44 UTC, meppl wrote: On Saturday, 7 April 2018 at 10:25:19 UTC, bauss wrote: On Saturday, 7 April 2018 at 09:07:48 UTC, sdvcn wrote: true?stt="AA":stt="BB";-///Out:BB It's an UB. Not a bug. I want `condition ? expr1 : expr2` to behav

Re: that is bug?

2018-04-07 Thread kdevel via Digitalmars-d
On Saturday, 7 April 2018 at 09:56:43 UTC, Jonathan M Davis wrote: true?stt="AA":stt="BB";-///Out:BB [...] Assignment takes precendence over the ternary operator. That's not true. Not in D and not in C/C++ https://wiki.dlang.org/Operator_precedence http://en.cppreferenc

Re: that is bug?

2018-04-07 Thread kdevel via Digitalmars-d
On Saturday, 7 April 2018 at 10:25:19 UTC, bauss wrote: On Saturday, 7 April 2018 at 09:07:48 UTC, sdvcn wrote: true?stt="AA":stt="BB";-///Out:BB It's an UB. Not a bug. Why UB? stt is only modified once.

Re: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, [your code here]

2018-04-07 Thread kdevel via Digitalmars-d
On Friday, 6 April 2018 at 14:03:18 UTC, Abdulhaq wrote: On Friday, 6 April 2018 at 13:10:07 UTC, jason wrote: what is this? It's a perl program that converts D code into APL +1

Re: that is bug?

2018-04-07 Thread Jonathan M Davis via Digitalmars-d
On Saturday, April 07, 2018 14:29:15 kdevel via Digitalmars-d wrote: > On Saturday, 7 April 2018 at 10:25:19 UTC, bauss wrote: > > On Saturday, 7 April 2018 at 09:07:48 UTC, sdvcn wrote: > >> true?stt="AA":stt="BB";-///Out:BB > > > > It's an UB. > > > > Not a bug. > > Why UB? st

Re: that is bug?

2018-04-07 Thread Jonathan M Davis via Digitalmars-d
On Saturday, April 07, 2018 14:28:05 kdevel via Digitalmars-d wrote: > On Saturday, 7 April 2018 at 09:56:43 UTC, Jonathan M Davis wrote: > >> true?stt="AA":stt="BB";-///Out:BB > > [...] > > > Assignment takes precendence over the ternary operator. > > That's not true. Not in D

Re: that is bug?

2018-04-07 Thread kdevel via Digitalmars-d
On Saturday, 7 April 2018 at 14:43:53 UTC, Jonathan M Davis wrote: On Saturday, April 07, 2018 14:29:15 kdevel via Digitalmars-d wrote: On Saturday, 7 April 2018 at 10:25:19 UTC, bauss wrote: > On Saturday, 7 April 2018 at 09:07:48 UTC, sdvcn wrote: >> true?stt="AA":stt="BB";

Re: that is bug?

2018-04-07 Thread Ali Çehreli via Digitalmars-d
On 04/07/2018 02:07 AM, sdvcn wrote: string stt = "none"; true?writeln("AA"):writeln("BB");   ///Out:AA     true?stt="AA":stt="BB";    -///Out:BB writeln(stt); It is a bug because the behavior does not match the spec: https://issues.dlang.org/show_bug.cgi?id=18743

Re: that is bug?

2018-04-07 Thread Patrick Schluter via Digitalmars-d
On Saturday, 7 April 2018 at 14:28:05 UTC, kdevel wrote: On Saturday, 7 April 2018 at 09:56:43 UTC, Jonathan M Davis wrote: true?stt="AA":stt="BB";-///Out:BB [...] Assignment takes precendence over the ternary operator. That's not true. Not in D and not in C/C++ The

Re: that is bug?

2018-04-07 Thread Ali via Digitalmars-d
On Saturday, 7 April 2018 at 15:26:56 UTC, Ali Çehreli wrote: On 04/07/2018 02:07 AM, sdvcn wrote: string stt = "none"; true?writeln("AA"):writeln("BB");   ///Out:AA     true?stt="AA":stt="BB";    -///Out:BB writeln(stt); It is a bug because the behavior does not ma

Re: that is bug?

2018-04-07 Thread Ali Çehreli via Digitalmars-d
On 04/07/2018 10:53 AM, Ali wrote: > On Saturday, 7 April 2018 at 15:26:56 UTC, Ali Çehreli wrote: >> On 04/07/2018 02:07 AM, sdvcn wrote: >>> string stt = "none"; >>> true?writeln("AA"):writeln("BB"); ///Out:AA >>> true?stt="AA":stt="BB";-///Out:BB >>> writel

Re: that is bug?

2018-04-07 Thread Ali via Digitalmars-d
On Saturday, 7 April 2018 at 18:52:56 UTC, Ali Çehreli wrote: On 04/07/2018 10:53 AM, Ali wrote: > On Saturday, 7 April 2018 at 15:26:56 UTC, Ali Çehreli wrote: >> On 04/07/2018 02:07 AM, sdvcn wrote: >>> string stt = "none"; >>> true?writeln("AA"):writeln("BB"); ///Out:AA >>>

Registering packages crashed DUB registry

2018-04-07 Thread 0xEAB via Digitalmars-d
Hello :) Tried to add a new package, but after clicking on [Register package] I only get the following error: 502 Bad Gateway nginx/1.6.2 Regards, Elias

Is it a bug that a parent class that access its own private members from derived classes gets deprecation warning?

2018-04-07 Thread bauss via Digitalmars-d
jesus that became a long title. Anyway as the title says, is it a bug that a parent class that access its own private members from derived classes gets deprecation warning? Scenario narrowed down: // module foo; class Foo { private: bool _baz; public: final void foos(T : Foo

Re: Is it a bug that a parent class that access its own private members from derived classes gets deprecation warning?

2018-04-07 Thread bauss via Digitalmars-d
On Saturday, 7 April 2018 at 20:14:49 UTC, bauss wrote: foreach (child; values) { child._isChild = true; } I forgot: _isChild should be _baz in the narrowed down version.

Re: Registering packages crashed DUB registry

2018-04-07 Thread bauss via Digitalmars-d
On Saturday, 7 April 2018 at 19:49:31 UTC, 0xEAB wrote: Hello :) Tried to add a new package, but after clicking on [Register package] I only get the following error: 502 Bad Gateway nginx/1.6.2 Regards, Elias I don't think that was the case. code.dlang.org has been having a lot of issu

Re: Is it a bug that a parent class that access its own private members from derived classes gets deprecation warning?

2018-04-07 Thread user1234 via Digitalmars-d
On Saturday, 7 April 2018 at 20:14:49 UTC, bauss wrote: jesus that became a long title. Anyway as the title says, is it a bug that a parent class that access its own private members from derived classes gets deprecation warning? If the import is selective no. (`import foo : Foo;`) If the imp

Re: Registering packages crashed DUB registry

2018-04-07 Thread 0xEAB via Digitalmars-d
On Saturday, 7 April 2018 at 20:17:41 UTC, bauss wrote: On Saturday, 7 April 2018 at 19:49:31 UTC, 0xEAB wrote: Hello :) Tried to add a new package, but after clicking on [Register package] I only get the following error: 502 Bad Gateway nginx/1.6.2 Regards, Elias I don't think that wa

Re: Is it a bug that a parent class that access its own private members from derived classes gets deprecation warning?

2018-04-07 Thread bauss via Digitalmars-d
On Saturday, 7 April 2018 at 20:46:39 UTC, bauss wrote: The problem is that "Foo" cannot access "_baz" without deperecation warning, but "_baz" is a part of "Foo". I'm not trying to access "_baz" directly from "Bar" except for that I call the templated function that access "_baz", but that fu

Re: Is it a bug that a parent class that access its own private members from derived classes gets deprecation warning?

2018-04-07 Thread bauss via Digitalmars-d
On Saturday, 7 April 2018 at 20:34:57 UTC, user1234 wrote: On Saturday, 7 April 2018 at 20:14:49 UTC, bauss wrote: jesus that became a long title. Anyway as the title says, is it a bug that a parent class that access its own private members from derived classes gets deprecation warning? If

Re: Registering packages crashed DUB registry

2018-04-07 Thread bauss via Digitalmars-d
On Saturday, 7 April 2018 at 20:44:12 UTC, 0xEAB wrote: On Saturday, 7 April 2018 at 20:17:41 UTC, bauss wrote: On Saturday, 7 April 2018 at 19:49:31 UTC, 0xEAB wrote: Hello :) Tried to add a new package, but after clicking on [Register package] I only get the following error: 502 Bad Gate

Re: that is bug?

2018-04-07 Thread kdevel via Digitalmars-d
On Saturday, 7 April 2018 at 16:52:00 UTC, Patrick Schluter wrote: [...] The odd man out is C++ [1], assignment has higher precedence because of right to left evaluation. Your reference [1] is not even a witness to your claim. The precedence table says that the "Ternary conditional" has the *

Re: that is bug?

2018-04-07 Thread kdevel via Digitalmars-d
On Saturday, 7 April 2018 at 19:44:35 UTC, Ali wrote: so it seems that since b = (true ? stt="AA": stt )="BB"; and b = true ? stt="AA": stt ="BB"; are equivalent that that the ternary operator return stt (after assigning it "AA") then assign "BB" to it Can the ternary conditional eve

Re: Registering packages crashed DUB registry

2018-04-07 Thread Sönke Ludwig via Digitalmars-d
Am 07.04.2018 um 21:49 schrieb 0xEAB: Hello :) Tried to add a new package, but after clicking on [Register package] I only get the following error: 502 Bad Gateway nginx/1.6.2 Regards, Elias Bug report: https://github.com/dlang/dub/issues/1441 PR: https://github.com/dlang/dub-registry/

Re: that is bug?

2018-04-07 Thread David Nadlinger via Digitalmars-d
On Saturday, 7 April 2018 at 21:22:07 UTC, kdevel wrote: Can the ternary conditional even be used to assign objects of the wrong type? […] Congratulations, I'm pretty sure you found an actual bug, even though it doesn't have anything to do with the conditional operator per se: https://issues

Re: that is bug?

2018-04-07 Thread David Nadlinger via Digitalmars-d
On Saturday, 7 April 2018 at 09:07:48 UTC, sdvcn wrote: true?stt="AA":stt="BB";-///Out:BB writeln(stt); As I just pointed out in Ali's bug report [1], this is correct, as true ? stt = "AA" : stt = "BB" means (true ? (stt = "AA") : stt) = "BB", in accordan

Re: Registering packages crashed DUB registry

2018-04-07 Thread Sönke Ludwig via Digitalmars-d
Am 07.04.2018 um 23:57 schrieb Sönke Ludwig: Am 07.04.2018 um 21:49 schrieb 0xEAB: Hello :) Tried to add a new package, but after clicking on [Register package] I only get the following error: 502 Bad Gateway nginx/1.6.2 Regards, Elias Bug report: https://github.com/dlang/dub/issues/1

Re: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, [your code here]

2018-04-07 Thread bauss via Digitalmars-d
On Friday, 6 April 2018 at 14:03:18 UTC, Abdulhaq wrote: On Friday, 6 April 2018 at 13:10:07 UTC, jason wrote: what is this? It's a perl program that converts D code into APL Here is a more readable version: (?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[ \t] )+|