Re: Benchmarking sigmoid function between C and D

2018-04-07 Thread Arun Chandrasekaran via Digitalmars-d-learn
On Saturday, 7 April 2018 at 23:48:36 UTC, kinke wrote: On Saturday, 7 April 2018 at 20:33:13 UTC, Arun Chandrasekaran wrote: [...] As this appears to be benchmarking mostly the std.math.exp(float) performance - some/many basic algos in std.math, incl. exp(), are currently using the x87 FPU

Re: Dockerfile with cross-compiler targeting Windows x64

2018-04-07 Thread kinke via Digitalmars-d-announce
On Saturday, 7 April 2018 at 14:05:15 UTC, Seb wrote: Hmm how hard would it be to use the MinGW libraries like DMD is doing as a fallback since 2.079? The MinGW ones for the Windows API may do, but the VS 2010 libraries are not an option for LDC, we require at least 2015 (which introduced

Re: HTTP-methods and encoding

2018-04-07 Thread Vindex via Digitalmars-d-learn
On Saturday, 7 April 2018 at 15:58:14 UTC, Seb wrote: On Saturday, 7 April 2018 at 13:02:39 UTC, Vindex wrote: There is an error on some sites when using HTTP-methods (std.net.curl.get, std.net.curl.post): std.encoding.EncodingException@std/encoding.d(2505): Unrecognized Encoding: utf8 Is

Re: Benchmarking sigmoid function between C and D

2018-04-07 Thread kinke via Digitalmars-d-learn
On Saturday, 7 April 2018 at 20:33:13 UTC, Arun Chandrasekaran wrote: Much better with mir.math.common, still a bit slower than C (even with larger loops): As this appears to be benchmarking mostly the std.math.exp(float) performance - some/many basic algos in std.math, incl. exp(), are

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]

Re: DIP 1009 (Add Expression-Based Contract Syntax) Accepted

2018-04-07 Thread Zach Tollen via Digitalmars-d-announce
On Saturday, 7 April 2018 at 20:06:19 UTC, Jordan Wilson wrote: Although https://dlang.org/spec/contracts.html will surely be updated with this new syntax, I think a blog post would also help in this regard, I think. Jordan That's a good idea. I'll start on one.

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:

[Issue 18744] Class l-values can be implicitly converted to `Object` l-values, even in safe code

2018-04-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18744 Stefan changed: What|Removed |Added CC||kde...@vogtner.de --

Re: Hamburg meets D

2018-04-07 Thread Stephan via Digitalmars-d-announce
On Wednesday, 4 April 2018 at 20:57:13 UTC, Stefan wrote: On Monday, 5 March 2018 at 19:40:12 UTC, Stephan wrote: Hello fellow Dlers, thanks to last years DConf some German D developers agreed to meet for drinks in Hamburg. congratz! how was it? hope a next meetup is already planned. It

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

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:

[Issue 18744] New: Class l-values can be implicitly converted to `Object` l-values, even in safe code

2018-04-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18744 Issue ID: 18744 Summary: Class l-values can be implicitly converted to `Object` l-values, even in safe code Product: D Version: D2 Hardware: All OS: All

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:

Re: Benchmarking sigmoid function between C and D

2018-04-07 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 7 April 2018 at 20:33:13 UTC, Arun Chandrasekaran wrote: On Saturday, 7 April 2018 at 19:14:27 UTC, Daniel Kozak wrote: or for ldc http://docs.algorithm.dlang.io/latest/mir_math_common.html On Sat, Apr 7, 2018 at 9:10 PM, Daniel Kozak wrote: can you try it

[Issue 18743] ConditionalExpression and AssignExpression should require parentheses

2018-04-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18743 --- Comment #2 from David Nadlinger --- (Note that this _is_ part of the specification in form of the grammar. Assignment is defined as AssignExpression: ConditionalExpression ConditionalExpression = AssignExpression

[Issue 18743] ConditionalExpression and AssignExpression should require parentheses

2018-04-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18743 David Nadlinger changed: What|Removed |Added CC||c...@klickverbot.at

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

Re: Store struct tuple of alias and access members through it?

2018-04-07 Thread Alex via Digitalmars-d-learn
On Saturday, 7 April 2018 at 13:31:01 UTC, Timoses wrote: Simen was faster :) In my solution I simply ignore such things as functions... But there is the cool delegate creation approach in Simen's solution for this. I can handle arrays instead. :) And I got rid of tupelof acting on an

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

[Issue 18743] Conditional expression (ternary operator) can evaluate the third expression even "If it is true"

2018-04-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18743 Ketmar Dark changed: What|Removed |Added CC|

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

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

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

Re: Benchmarking sigmoid function between C and D

2018-04-07 Thread Arun Chandrasekaran via Digitalmars-d-learn
On Saturday, 7 April 2018 at 19:14:27 UTC, Daniel Kozak wrote: or for ldc http://docs.algorithm.dlang.io/latest/mir_math_common.html On Sat, Apr 7, 2018 at 9:10 PM, Daniel Kozak wrote: can you try it with c math functions? instead of std.math, try to use core.stdc.math

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

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

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.

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 :

Create bitcoin genesis block in d language

2018-04-07 Thread aerto via Digitalmars-d-announce
was playing around with d, i write a pure implementation of bitcoin genesis block creation in dlang https://github.com/cvsae/genesisd

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

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

Re: Store struct tuple of alias and access members through it?

2018-04-07 Thread Simen Kjærås via Digitalmars-d-learn
On Saturday, 7 April 2018 at 13:31:01 UTC, Timoses wrote: In the end I would like to accomplish the following: Provide access to contained bitfields and members of a struct in the order they appear in the struct via an index. The behavior of Type.tupleof in D seems a bit unfinished - they

Re: Benchmarking sigmoid function between C and D

2018-04-07 Thread Daniel N via Digitalmars-d-learn
On Saturday, 7 April 2018 at 18:53:57 UTC, Arun Chandrasekaran wrote: What am I doing wrong here that makes the D equivalent 2.5 times slower than it's C equivalent? Compilers used: LDC2: LDC - the LLVM D compiler (1.8.0) GCC: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 11:36:39

Re: Benchmarking sigmoid function between C and D

2018-04-07 Thread Daniel Kozak via Digitalmars-d-learn
or for ldc http://docs.algorithm.dlang.io/latest/mir_math_common.html On Sat, Apr 7, 2018 at 9:10 PM, Daniel Kozak wrote: > can you try it with c math functions? > > instead of std.math, try to use core.stdc.math > > On Sat, Apr 7, 2018 at 8:53 PM, Arun Chandrasekaran via >

Re: Benchmarking sigmoid function between C and D

2018-04-07 Thread Daniel Kozak via Digitalmars-d-learn
can you try it with c math functions? instead of std.math, try to use core.stdc.math On Sat, Apr 7, 2018 at 8:53 PM, Arun Chandrasekaran via Digitalmars-d-learn wrote: > What am I doing wrong here that makes the D equivalent 2.5 times slower > than it's C

Benchmarking sigmoid function between C and D

2018-04-07 Thread Arun Chandrasekaran via Digitalmars-d-learn
What am I doing wrong here that makes the D equivalent 2.5 times slower than it's C equivalent? Compilers used: LDC2: LDC - the LLVM D compiler (1.8.0) GCC: gcc (Ubuntu 5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609 11:36:39 ~/code/c/test2$ ldc2 sigmoid.d -O5 && ./sigmoid Max deviation is 0.001664

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

Beta 2.079.1

2018-04-07 Thread Martin Nowak via Digitalmars-d-announce
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 First beta for the 2.079.1 patch release. Comes with a handful of fixes. http://dlang.org/download.html#dmd_beta http://dlang.org/changelog/2.079.1.html Please report any bugs at https://issues.dlang.org - -Martin -BEGIN PGP SIGNATURE-

Re: std.datetime.systime: days Deprecation message

2018-04-07 Thread Alex via Digitalmars-d-learn
On Saturday, 7 April 2018 at 17:25:07 UTC, Vino wrote: Hi All, Request your help on the below Deprecation message. import std.datetime.systime: Clock, days, SysTime; void main (int AgeSize) { int AgeSize = 1 auto ct2 = Clock.currTime(), st2 = ct2 + days(-AgeSize); } test.d(30): Deprecation:

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

std.datetime.systime: days Deprecation message

2018-04-07 Thread Vino via Digitalmars-d-learn
Hi All, Request your help on the below Deprecation message. import std.datetime.systime: Clock, days, SysTime; void main (int AgeSize) { int AgeSize = 1 auto ct2 = Clock.currTime(), st2 = ct2 + days(-AgeSize); } test.d(30): Deprecation: Symbol core.time.days is not visible from module

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: HTTP-methods and encoding

2018-04-07 Thread Seb via Digitalmars-d-learn
On Saturday, 7 April 2018 at 13:02:39 UTC, Vindex wrote: There is an error on some sites when using HTTP-methods (std.net.curl.get, std.net.curl.post): std.encoding.EncodingException@std/encoding.d(2505): Unrecognized Encoding: utf8 Is there a beautiful way around it? For the GET-method I use

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:

[Issue 18743] New: Conditional expression (ternary operator) can evaluate the third expression even "If it is true"

2018-04-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18743 Issue ID: 18743 Summary: Conditional expression (ternary operator) can evaluate the third expression even "If it is true" Product: D Version: D2 Hardware: x86_64

[Issue 18742] New: std.regex: Using CodePointSet in AAs breaks if reference count changes

2018-04-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18742 Issue ID: 18742 Summary: std.regex: Using CodePointSet in AAs breaks if reference count changes Product: D Version: D2 Hardware: All OS: All Status:

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

[Issue 18026] Stack overflow in ddmd/dtemplate.d:6241, TemplateInstance::needsCodegen()

2018-04-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18026 --- Comment #5 from JR --- (In reply to Seb from comment #4) > JR: Cool! I can reproduce it on my machine too :) [...] > I will look at reducing this even further tomorrow. Awesome, thanks! --

Re: How to destruct class instances allocated by a Region-allocator over a single GC block

2018-04-07 Thread Per Nordlöw via Digitalmars-d-learn
On Saturday, 7 April 2018 at 07:50:37 UTC, Eduard Staniloiu wrote: On Friday, 6 April 2018 at 21:49:37 UTC, Per Nordlöw wrote: On Tuesday, 3 April 2018 at 09:14:28 UTC, Eduard Staniloiu wrote: So, say `reg` is your allocator, your workflow would be auto obj = reg.make!Type(args); /* do stuff

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

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?

Re: Function template argument deduction

2018-04-07 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 7 April 2018 at 14:02:55 UTC, Paul Backus wrote: Interesting. Looks like this is an issue with aliases, because I get the error with this code too: --- test.d import std.typecons: Tuple, tuple; alias Pair(T) = Tuple!(T, T); void foo(T)(Pair!T p) { return; } unittest {

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

[Issue 18026] Stack overflow in ddmd/dtemplate.d:6241, TemplateInstance::needsCodegen()

2018-04-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18026 --- Comment #4 from Seb --- JR: Cool! I can reproduce it on my machine too :) For reference, here's what's necessary for reproducing this without dub: /home/seb/dlang/dmd/generated/linux/release/64/dmd -c -offoo.o -w

Re: Dockerfile with cross-compiler targeting Windows x64

2018-04-07 Thread Seb via Digitalmars-d-announce
On Saturday, 7 April 2018 at 12:24:54 UTC, kinke wrote: Any MS libs that can be bundled "legally"? That's the problem. If there were, they'd be bundled with the LDC Windows packages, so that LDC on Windows wouldn't require a Visual C++ installation anymore and just work out of the box. To

Re: dustmite watch shell script (.test vs .lookahead.*)

2018-04-07 Thread Anonymouse via Digitalmars-d-learn
On Friday, 6 April 2018 at 15:42:04 UTC, Vladimir Panteleev wrote: On Friday, 6 April 2018 at 15:35:59 UTC, Anonymouse wrote: The dustmite wiki[0] lists the following example script for use to monitor the reduction progress: Here's a more complete version that also works with -j:

Re: Function template argument deduction

2018-04-07 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 7 April 2018 at 06:26:24 UTC, Uknown wrote: What I did notice though is that when `string list2string(T)(List!T list)` was changed to `string list2string(T)(VariantN!(16LU, Nil, Tuple!(T, "head", This*, "tail")) list)` The compiler correctly deduce `T` to be `int` Interesting.

[Issue 18026] Stack overflow in ddmd/dtemplate.d:6241, TemplateInstance::needsCodegen()

2018-04-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18026 --- Comment #3 from JR --- I reduced it to 58 lines using dustmite, which is incidentally amazing. Under 2.079.0, it compiles in -debug mode but doesn't outside of it. 2.078.3 can however compile it in both. The code is nonsense,

Communal Benevolence Required

2018-04-07 Thread Mike Parker via Digitalmars-d-announce
If you've been considering helping out the D Language Foundation with a donation, right now is a beneficial time to do it. With DConf just around the corner, every dime counts! Blog https://dlang.org/blog/2018/04/07/communal-benevolence-required/ Reddit

Store struct tuple of alias and access members through it?

2018-04-07 Thread Timoses via Digitalmars-d-learn
(Please read at the very bottom what I'd like to achieve) Is it possible to return the member of a struct by its .tupleof index? I know that it would work on a struct value, but I'd like it to work on the type's tupleof: ``` struct S { int i;} S s; // below leads to: Error: need this for

HTTP-methods and encoding

2018-04-07 Thread Vindex via Digitalmars-d-learn
There is an error on some sites when using HTTP-methods (std.net.curl.get, std.net.curl.post): std.encoding.EncodingException@std/encoding.d(2505): Unrecognized Encoding: utf8 Is there a beautiful way around it? For the GET-method I use the download() and readText(). But for the POST-method I

Re: code-d 0.17.0 + serve-d 0.1.2

2018-04-07 Thread WebFreak001 via Digitalmars-d-announce
On Friday, 6 April 2018 at 19:12:32 UTC, Wulfklaue wrote: Nice job WebFreak001 on the new changes. For the first time in years the code-d plugin works out of the box on Windows without any issues. A small tip: associate the .d file extension in the Visual Studio Code marketplace with Code-d.

Re: Dockerfile with cross-compiler targeting Windows x64

2018-04-07 Thread kinke via Digitalmars-d-announce
On Friday, 6 April 2018 at 04:08:41 UTC, Seb wrote: On Thursday, 5 April 2018 at 11:46:42 UTC, Jacob Carlborg wrote: I've created a Dockerfile [1] containing LDC, configured for cross-compiling targeting Windows x64. Thanks for doing this. BTW I just tested this and it works really nicely (I

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

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,

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

[Issue 18471] std.experimental.checkedint.Checked doesn't check on assignment or construction

2018-04-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18471 petrug changed: What|Removed |Added CC||petru.guri...@gmail.com

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: Game and GC

2018-04-07 Thread Danni Coy via Digitalmars-d-learn
gc causes unpredictabilities in performance*. With games it tends to be worst case performance that matters. I would reccomend using std.experimental.allocator (even if you still use the default GC backed allocator). This will allow you to swap out your allocator for a more specialised one as

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

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: How to destruct class instances allocated by a Region-allocator over a single GC block

2018-04-07 Thread Eduard Staniloiu via Digitalmars-d-learn
On Friday, 6 April 2018 at 21:49:37 UTC, Per Nordlöw wrote: On Tuesday, 3 April 2018 at 09:14:28 UTC, Eduard Staniloiu wrote: So, say `reg` is your allocator, your workflow would be auto obj = reg.make!Type(args); /* do stuff */ reg.dispose(obj); // If Type has a __dtor, it will call

Re: Function template argument deduction

2018-04-07 Thread Ali Çehreli via Digitalmars-d-learn
On 04/06/2018 11:26 PM, Uknown wrote: > On Saturday, 7 April 2018 at 05:58:10 UTC, Paul Backus wrote: >> On Saturday, 7 April 2018 at 05:46:07 UTC, Uknown wrote: >>> I don't see the error you are talking about: >>> https://run.dlang.io/is/XWPIc1 >>> >>> Are you using the latest compiler? >> >>

Re: Function template argument deduction

2018-04-07 Thread Uknown via Digitalmars-d-learn
On Saturday, 7 April 2018 at 05:58:10 UTC, Paul Backus wrote: On Saturday, 7 April 2018 at 05:46:07 UTC, Uknown wrote: I don't see the error you are talking about: https://run.dlang.io/is/XWPIc1 Are you using the latest compiler? Compile with -unittest. And yes; I'm using DMD 2.079.0.

Re: Function template argument deduction

2018-04-07 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 7 April 2018 at 05:46:07 UTC, Uknown wrote: I don't see the error you are talking about: https://run.dlang.io/is/XWPIc1 Are you using the latest compiler? Compile with -unittest. And yes; I'm using DMD 2.079.0.