Re: Always false float comparisons

2017-06-29 Thread Ecstatic Coder via Digitalmars-d
On Thursday, 29 June 2017 at 19:12:24 UTC, ag0aep6g wrote: On Thursday, 29 June 2017 at 18:03:39 UTC, Ecstatic Coder wrote: I often do code like "x < array.length" where x needs to be a long to be able to handle negative values. I want my code to compile without warning, and therefore I'm

[Issue 17577] 20%+ Performance degradation in std.conv.to due to 'import std.getopt'

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17577 Jon Degenhardt changed: What|Removed |Added Status|NEW |RESOLVED

Re: Always false float comparisons

2017-06-29 Thread Ecstatic Coder via Digitalmars-d
On Thursday, 29 June 2017 at 19:12:24 UTC, ag0aep6g wrote: On Thursday, 29 June 2017 at 18:03:39 UTC, Ecstatic Coder wrote: I often do code like "x < array.length" where x needs to be a long to be able to handle negative values. I want my code to compile without warning, and therefore I'm

Re: Overloading funtion templates.

2017-06-29 Thread vit via Digitalmars-d-learn
On Thursday, 29 June 2017 at 06:40:04 UTC, Balagopal Komarath wrote: On Wednesday, 28 June 2017 at 12:19:31 UTC, vit wrote: auto foo(alias F, T)(T x) { return x.foo(); } With this definition foo!((x) => x+1)(3); doesn't work. Is there a way to solve this? You don´t need overload

Re: Win10 defender still sees dmd.exe and rdmd.exe as malicious

2017-06-29 Thread Matt via Digitalmars-d
On Wednesday, 28 June 2017 at 14:21:24 UTC, Mike Parker wrote: On Monday, 26 June 2017 at 02:55:17 UTC, Matt wrote: Which version of the compiler? Which version of Windows? I'm on Windows 10 with 2.074.1 currently and never seen it with any version of DMD. DMD is 2.074.1, windows10 pro

Bulk allocation and partial deallocation for tree data structures.

2017-06-29 Thread Filip Bystricky via Digitalmars-d-learn
Hello! I'm implementing a persistent hash trie (like in clojure/scala). Every 'persisting' insertion involves allocating a fixed number (6) of nodes (each chunk is a fixed width ranging between 1 and ~33 words). Basically, this data structure always allocates a whole branch at a time, but

[Issue 17577] 20%+ Performance degradation in std.conv.to due to 'import std.getopt'

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17577 --- Comment #3 from Jon Degenhardt --- Properly adding -inline to the DMD compiler line eliminates the degradation in the DMD builds, at least in 2.075.0-b1. (I deleted 2.074 when updating to beta-1.) The updated

[Issue 17577] 20%+ Performance degradation in std.conv.to due to 'import std.getopt'

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17577 --- Comment #2 from Jon Degenhardt --- (In reply to Vladimir Panteleev from comment #1) > Reproducible on Linux x86_64 (11.6 / 10.6 seconds with dmd) > > (In reply to Jon Degenhardt from comment #0) > > Implication so

[Issue 17577] 20%+ Performance degradation in std.conv.to due to 'import std.getopt'

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17577 Vladimir Panteleev changed: What|Removed |Added CC|

mysql-native + vibe.d example

2017-06-29 Thread crimaniak via Digitalmars-d-learn
Hi! Moving my project from mysql-lited to mysql-native I faced the problem with null pointer error inside of mysql-native: Log: SELECT id FROM versionupdate ORDER BY id Task terminated with unhandled exception: etc.linux.memoryerror.NullPointerError@src/etc/linux/memoryerror.d(325)

[Issue 17577] New: 20%+ Performance degradation in std.conv.to due to 'import std.getopt'

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17577 Issue ID: 17577 Summary: 20%+ Performance degradation in std.conv.to due to 'import std.getopt' Product: D Version: D2 Hardware: x86 OS: Mac OS X

[Issue 17576] mixin template cannot define alias

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17576 Bolpat changed: What|Removed |Added Keywords||rejects-valid --

[Issue 17576] New: mixin template cannot define alias

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17576 Issue ID: 17576 Summary: mixin template cannot define alias Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1

Re: D and Meson

2017-06-29 Thread Matthias Klumpp via Digitalmars-d
On Monday, 19 June 2017 at 12:21:24 UTC, Mike B Johnson wrote: [...] Funny: "The main design point of Meson is that every moment a developer spends writing or debugging build definitions is a second wasted. So is every second spent waiting for the build system to actually start compiling

Re: dmd debian installation conflicts with debian-goodies

2017-06-29 Thread Matthias Klumpp via Digitalmars-d
On Wednesday, 28 June 2017 at 10:09:06 UTC, Ralph Amissah wrote: Installing dmd if debian-goodies is installed fails. Both try to write a file named '/usr/bin/dman' Debian Stretch is out, the freeze is over, perhaps now dmd will soon be available as a package in Debian? Ldc2 does a great job

[Issue 17574] Range violation in std.getopt:getopt AA parsing

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17574 hst...@quickfur.ath.cx changed: What|Removed |Added CC||hst...@quickfur.ath.cx --

[Issue 17575] New: named mixin template error message

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17575 Issue ID: 17575 Summary: named mixin template error message Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority:

Re: dub seems to have forgotten my versions

2017-06-29 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 28 June 2017 at 21:25:18 UTC, jmh530 wrote: On Wednesday, 28 June 2017 at 20:18:20 UTC, jmh530 wrote: On Wednesday, 28 June 2017 at 19:54:01 UTC, jmh530 wrote: [snip] Does not seem to be a problem for another project using dub with dmd and similar dependencies... After

Re: Alias template parameter to a private function

2017-06-29 Thread Sebastien Alaiwan via Digitalmars-d-learn
On Thursday, 29 June 2017 at 20:21:13 UTC, Ali Çehreli wrote: A workaround is to use a lambda: filter!(a => isValid(a))(array) Thanks! Nice trick, this is definitely going into my company's codebase :-) Such limitations are pretty annoying. There were a number of similar issues in

[Issue 17574] New: Range violation in std.getopt:getopt AA parsing

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17574 Issue ID: 17574 Summary: Range violation in std.getopt:getopt AA parsing Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal

Re: Checked vs unchecked exceptions

2017-06-29 Thread Ola Fosheim Grøstad via Digitalmars-d
On Thursday, 29 June 2017 at 19:34:22 UTC, Crayo List wrote: Checked exceptions are a horrible idea because they leak internal implementation details as part of the signature of a method directly and in a transitive manner, which of course is one huge aberration! What do you mean? Exceptions

Re: Advice wanted on garbage collection of sockets for c++ programmer using D

2017-06-29 Thread Meta via Digitalmars-d-learn
On Wednesday, 28 June 2017 at 15:55:41 UTC, John Burton wrote: On Tuesday, 27 June 2017 at 09:54:19 UTC, John Burton wrote: I'm coming from a C++ background so I'm not too used to garbage collection and it's implications. I have a function that creates a std.socket.Socket using new and

Re: Alias template parameter to a private function

2017-06-29 Thread Ali Çehreli via Digitalmars-d-learn
On 06/24/2017 02:04 AM, Sebastien Alaiwan wrote: > private: > > void privateFunction1() > { > auto array = [0, 1, 2, 3, 4, 5]; > auto result = filter!isValid(array); // error: 'isValid' is private > } > bool isValid(int i) > { > return i % 2 == 0; > } A workaround is to use a lambda:

[Issue 17572] unrestricted union erroneously invokes postblit

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17572 --- Comment #1 from ki...@gmx.net --- Not a bug, as the copy and postblit happens correctly when constructing the `cast(POD!Node)val` rvalue, see https://github.com/ldc-developers/ldc/issues/2185. --

Re: Checked vs unchecked exceptions

2017-06-29 Thread Crayo List via Digitalmars-d
On Monday, 26 June 2017 at 15:40:19 UTC, mckoder wrote: Here's the point: with checked exceptions good programmers can write good code. Without checked exceptions even good programmers are forced to write bad code. This statement is logically equivalent to "good code can only be written

Re: Beta 2.075.0-b1

2017-06-29 Thread H. S. Teoh via Digitalmars-d-announce
On Thu, Jun 29, 2017 at 12:27:33AM -0700, Walter Bright via Digitalmars-d-announce wrote: > On 6/28/2017 7:02 PM, H. S. Teoh via Digitalmars-d-announce wrote: > > I've been seeing occasional linker errors when compiling with > > -dip1000 that go away when I drop -dip1000. However, I haven't had >

[Issue 17573] New: Make opCmp more flexible

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17573 Issue ID: 17573 Summary: Make opCmp more flexible Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1

What are your hopes for the future D GC

2017-06-29 Thread Random D user via Digitalmars-d
I just got curious, after reading the GC analysis blog post. What kind of features people generally would want for the GC (in the distant murky future of 1999)? Here's some of my nice to haves: 1. Thread local GCs. D is by default thread local, so it kind of would make sense and goodbye stop

Re: Always false float comparisons

2017-06-29 Thread ag0aep6g via Digitalmars-d
On Thursday, 29 June 2017 at 18:03:39 UTC, Ecstatic Coder wrote: I often do code like "x < array.length" where x needs to be a long to be able to handle negative values. I want my code to compile without warning, and therefore I'm against requiring "x < array.length.to!long()" to remove that

Re: Always false float comparisons

2017-06-29 Thread Ecstatic Coder via Digitalmars-d
On Monday, 9 May 2016 at 11:16:53 UTC, ZombineDev wrote: On Monday, 9 May 2016 at 09:10:19 UTC, Walter Bright wrote: Don Clugston pointed out in his DConf 2016 talk that: float f = 1.30; assert(f == 1.30); will always be false since 1.30 is not representable as a float. However,

Re: Alias template parameter to a private function

2017-06-29 Thread Sebastien Alaiwan via Digitalmars-d-learn
up please!

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-29 Thread H. S. Teoh via Digitalmars-d
On Thu, Jun 29, 2017 at 08:22:50AM +, via Digitalmars-d wrote: > On Thursday, 29 June 2017 at 01:37:17 UTC, H. S. Teoh wrote: [...] > > One idea I have is that the compiler could recognize certain > > straightforward contracts (like int < value) and use VRP (value > > range propagation) to

[Issue 17571] Cannot create alias of __traits(getMember, ...)

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17571 Vladimir Panteleev changed: What|Removed |Added CC|

Re: CTFE Status 2

2017-06-29 Thread Steven Schveighoffer via Digitalmars-d
On 6/29/17 4:24 AM, Stefan Koch wrote: On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote: [ ... ] I just "discovered" a bug in my debugging system. Which caused me to debug the wrong function for about 5 hours. Since I really could not see why the codegen would produce such

Re: Serialization/deserialization of templated class

2017-06-29 Thread Steven Schveighoffer via Digitalmars-d
On 6/28/17 1:52 AM, Dmitry Solomennikov wrote: On Wednesday, 28 June 2017 at 05:01:17 UTC, Eugene Wissner wrote: On Wednesday, 28 June 2017 at 04:41:25 UTC, Dmitry Solomennikov wrote: Probably if you have serialized data, you convert strings to other types, so it may be possible to perfom

Re: Let's paint those bikesheds^Werror messages!

2017-06-29 Thread bauss via Digitalmars-d
On Thursday, 29 June 2017 at 14:35:00 UTC, Vladimir Panteleev wrote: On Thursday, 29 June 2017 at 14:33:19 UTC, bauss wrote: On Tuesday, 27 June 2017 at 14:32:28 UTC, Vladimir Panteleev wrote: - Yes, not everyone likes colors. You can turn all colors off with a command-line switch. Which is?

Re: Let's paint those bikesheds^Werror messages!

2017-06-29 Thread Vladimir Panteleev via Digitalmars-d
On Thursday, 29 June 2017 at 14:33:19 UTC, bauss wrote: On Tuesday, 27 June 2017 at 14:32:28 UTC, Vladimir Panteleev wrote: - Yes, not everyone likes colors. You can turn all colors off with a command-line switch. Which is? -color=off As with almost any other program, you can get a list of

Re: Let's paint those bikesheds^Werror messages!

2017-06-29 Thread bauss via Digitalmars-d
On Tuesday, 27 June 2017 at 14:32:28 UTC, Vladimir Panteleev wrote: - Yes, not everyone likes colors. You can turn all colors off with a command-line switch. Which is?

[Issue 17564] std.experimental.allocator.theAllocator is null within shared static this

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17564 --- Comment #1 from github-bugzi...@puremagic.com --- Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/4a5d2b3b189f072e9bd0b1779a7d585e3945921b Fix issue 17564: Eliminate "static this" for

[Issue 17571] Cannot create alias of __traits(getMember, ...)

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17571 --- Comment #2 from Shachar Shemesh --- (In reply to Vladimir Panteleev from comment #1) > It is a syntax issue. See: > https://blog.thecybershadow.net/2015/04/28/the-amazing-template-that-does- > nothing/ I'm sorry, I don't

[Issue 17572] New: unrestricted union erroneously invokes postblit

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17572 Issue ID: 17572 Summary: unrestricted union erroneously invokes postblit Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: critical

Re: How to partially apply member functions?

2017-06-29 Thread ct via Digitalmars-d-learn
I was only able to do it this way: auto on_next_previous = entry_.addOnNextMatch(!(on_next_previous, true)); entry_.addOnPreviousMatch(!(on_next_previous, false));

Re: Force usage of double (instead of higher precision)

2017-06-29 Thread Stefan Koch via Digitalmars-d-learn
On Thursday, 29 June 2017 at 12:02:48 UTC, Simon Bürger wrote: On Thursday, 29 June 2017 at 00:07:35 UTC, kinke wrote: On Wednesday, 28 June 2017 at 22:16:48 UTC, Simon Bürger wrote: I am currently using LDC on 64-bit-Linux if that is relevant. It is, as LDC on Windows/MSVC would use 64-bit

[Issue 17571] Cannot create alias of __traits(getMember, ...)

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17571 Vladimir Panteleev changed: What|Removed |Added Hardware|x86_64 |All

[Issue 17570] Misleading error message illegal conditional function definition

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17570 Vladimir Panteleev changed: What|Removed |Added Keywords|

Re: How to partially apply member functions?

2017-06-29 Thread ct via Digitalmars-d-learn
On Thursday, 29 June 2017 at 12:31:58 UTC, ct wrote: I have something similar to the following: class Editor { void OnNextPreviousMatch(bool is_forward, SearchEntry entry) { } } I pressed send by mistake. Again, I have something similar to the following: class Editor { void

How to partially apply member functions?

2017-06-29 Thread ct via Digitalmars-d-learn
I have something similar to the following: class Editor { void OnNextPreviousMatch(bool is_forward, SearchEntry entry) { } }

Re: Force usage of double (instead of higher precision)

2017-06-29 Thread Simon Bürger via Digitalmars-d-learn
On Thursday, 29 June 2017 at 00:07:35 UTC, kinke wrote: On Wednesday, 28 June 2017 at 22:16:48 UTC, Simon Bürger wrote: I am currently using LDC on 64-bit-Linux if that is relevant. It is, as LDC on Windows/MSVC would use 64-bit compile-time reals. ;) Changing it to double on other

Re: Force usage of double (instead of higher precision)

2017-06-29 Thread Simon Bürger via Digitalmars-d-learn
Thanks a lot for your comments. On Wednesday, 28 June 2017 at 23:56:42 UTC, Stefan Koch wrote: [...] Nice work can you re or dual license under the boost license ? I'd like to incorporate the qd type into newCTFE. The original work is not mine but traces back to

Re: Let's paint those bikesheds^Werror messages!

2017-06-29 Thread Danni Coy via Digitalmars-d
This times 1000 On Wed, Jun 28, 2017 at 3:11 AM, H. S. Teoh via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On Tue, Jun 27, 2017 at 02:32:28PM +, Vladimir Panteleev via > Digitalmars-d wrote: > > As has been announced, DMD now has colorized syntax highlighting in > > error

Re: Can't get UDAs of constants (enums) !

2017-06-29 Thread Walter Bright via Digitalmars-d
On 6/24/2017 10:42 AM, Johan Engelen wrote: [1] https://issues.dlang.org/show_bug.cgi?id=17545 https://github.com/dlang/dmd/pull/6949

[Issue 17545] [REG2.072] __traits(getAttributes, name) evaluates name to value prematurely

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17545 --- Comment #5 from Walter Bright --- https://github.com/dlang/dmd/pull/6949 --

Re: CTFE Status 2

2017-06-29 Thread Stefan Koch via Digitalmars-d
On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote: [ ... ] I just "discovered" a bug in my debugging system. Which caused me to debug the wrong function for about 5 hours. Since I really could not see why the codegen would produce such vastly different code. (Almost as if it

Re: DIP 1009--Improve Contract Usability--Preliminary Review Round 1

2017-06-29 Thread via Digitalmars-d
On Thursday, 29 June 2017 at 01:37:17 UTC, H. S. Teoh wrote: On Thu, Jun 29, 2017 at 01:22:31AM +, Mark via Digitalmars-d wrote: [...] So basically, I'd like the ability to implement fairly simple contracts (with a similar level of sophistication to the above examples) that the compiler

Re: Let's paint those bikesheds^Werror messages!

2017-06-29 Thread Vladimir Panteleev via Digitalmars-d
On Thursday, 29 June 2017 at 01:45:11 UTC, Nick Sabalausky (Abscissa) wrote: Hasn't DMD already been coloring error messages for about the past year? Or is it DUB that's been doing that to DMD's output? Or are we talking about something different then what was already there? Please, click,

[Issue 17545] [REG2.072] __traits(getAttributes, name) evaluates name to value prematurely

2017-06-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17545 Walter Bright changed: What|Removed |Added CC|

Re: Beta 2.075.0-b1

2017-06-29 Thread Walter Bright via Digitalmars-d-announce
On 6/28/2017 7:09 PM, Dsby wrote: On Thursday, 29 June 2017 at 01:44:10 UTC, Walter Bright wrote: On 6/27/2017 12:51 AM, Dsby wrote: what about DIP1000? Is it default? No. When will it be default? 2.076 or 2.077? I don't know at the moment. Currently, Phobos doesn't compile with it on

Re: Beta 2.075.0-b1

2017-06-29 Thread Walter Bright via Digitalmars-d-announce
On 6/28/2017 7:02 PM, H. S. Teoh via Digitalmars-d-announce wrote: I've been seeing occasional linker errors when compiling with -dip1000 that go away when I drop -dip1000. However, I haven't had the time to reduce the code sufficiently to file a bug. Is this a known issue, or should I schedule