Re: DIP 1006 - Preliminary Review Round 1

2018-03-06 Thread Timon Gehr via Digitalmars-d
On 06.03.2018 03:05, Walter Bright wrote: On 3/5/2018 2:30 PM, John Colvin wrote: This just feels bad. Adding extra failsafes for my debug program shouldn't make my release program less safe. Then use `enforce()`. That makes no sense at all. Enforce is for conditions that are expected to

Re: Thread Function does not executes

2018-03-06 Thread Vino via Digitalmars-d-learn
On Monday, 5 March 2018 at 13:50:28 UTC, Vino wrote: Hi All, Request your help, I have 3 functions such as below, I am calling these function using another function ptManage which executes these function's in parallel as each of the below 3 function run's on 10 - 12 different file systems,

Re: DIP 1006 - Preliminary Review Round 1

2018-03-06 Thread Walter Bright via Digitalmars-d
On 3/6/2018 12:45 AM, Timon Gehr wrote: Anyway, "do not use assert" is not the solution, as I have explained many times now. My interpretation is you want D assert to behave like C assert. C assert and enforce are purely creatures of the library, with semantics defined by their library

Re: Speed of math function atan: comparison D and C++

2018-03-06 Thread J-S Caux via Digitalmars-d-learn
On Tuesday, 6 March 2018 at 07:12:57 UTC, Robert M. Münch wrote: On 2018-03-05 20:11:06 +, H. S. Teoh said: Walter has been adamant that we should always compute std.math.* functions with the `real` type, which on x86 maps to the non-IEEE 80-bit floats. However, 80-bit floats have been

Re: Speed of math function atan: comparison D and C++

2018-03-06 Thread Andrea Fontana via Digitalmars-d-learn
On Monday, 5 March 2018 at 20:11:06 UTC, H. S. Teoh wrote: Walter has been adamant that we should always compute std.math.* functions with the `real` type T I don't understand why atan(float) returns real and atan(double) return real too. If I'm working with float, why does it return a

Re: Speed of math function atan: comparison D and C++

2018-03-06 Thread Uknown via Digitalmars-d-learn
On Tuesday, 6 March 2018 at 08:20:05 UTC, J-S Caux wrote: On Tuesday, 6 March 2018 at 07:12:57 UTC, Robert M. Münch wrote: On 2018-03-05 20:11:06 +, H. S. Teoh said: [snip] Now, with Uknown's trick of using the C math functions, I can reconsider. It's a bit of a "patch" but at least it

Re: Why does this not compile?

2018-03-06 Thread Shachar Shemesh via Digitalmars-d
On 06/03/18 12:16, Diego wrote: You cannot assign a const element (`a`) to a non-const element (`b`) in `S b = a` expression. Sure you can. During assignment you are making a copy. Why do you care whether the original is const? Shachar

Re: Validity of cast(void*)size_t.max

2018-03-06 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/6/18 1:08 AM, Kagamin wrote: On Monday, 5 March 2018 at 18:28:43 UTC, Steven Schveighoffer wrote: Note, I think the error is bogus, you should be able to create hard-coded addresses of data at compile time -- I'm not sure how you would do hardware registers otherwise. I'd do them as

Re: Article: Why Const Sucks

2018-03-06 Thread Dukc via Digitalmars-d-announce
On Tuesday, 6 March 2018 at 11:03:24 UTC, Nemanja Boric wrote: title = title.dup;// doesn't work anymore Strange! You're right it does not when the type declares a member as const, yet: On Monday, 5 March 2018 at 10:57:35 UTC, Jonathan M Davis wrote (in the article): And if an

[Issue 18560] find on infinite ranges is broken

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18560 --- Comment #2 from FeepingCreature --- No, this is the actual problem! struct Struct { enum Enum = 5; } bool fooEvaluated; Struct foo() { fooEvaluated = true; return Struct(); } assert(foo().Enum == 5);

Re: Release D 2.079.0

2018-03-06 Thread Steven Schveighoffer via Digitalmars-d-announce
On 3/5/18 6:40 PM, Atila Neves wrote: On Monday, 5 March 2018 at 17:47:13 UTC, Seb wrote: On Monday, 5 March 2018 at 15:16:14 UTC, Atila Neves wrote: On Saturday, 3 March 2018 at 01:50:25 UTC, Martin Nowak wrote: Glad to announce D 2.079.0. This release comes with experimental `@nogc`

[Issue 18562] New: expression is not evaluated when accessing manifest constant

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18562 Issue ID: 18562 Summary: expression is not evaluated when accessing manifest constant Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW

Re: Article: Why Const Sucks

2018-03-06 Thread Steven Schveighoffer via Digitalmars-d-announce
On 3/6/18 1:49 AM, Jonathan M Davis wrote: Regardless, I doubt that the design of ranges is going to be changed at this point given the amount of code that would break as a result, and these sort of changes are not backwards compatible. I sometimes think we would be better off to drop

[Issue 18560] find on infinite ranges is broken

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18560 ag0ae...@gmail.com changed: What|Removed |Added Keywords||wrong-code CC|

Re: Release D 2.079.0

2018-03-06 Thread Steven Schveighoffer via Digitalmars-d-announce
On 3/6/18 2:11 AM, Jonathan M Davis wrote: On Tuesday, March 06, 2018 05:34:39 psychoticRabbit via Digitalmars-d- announce wrote: On Tuesday, 6 March 2018 at 05:22:58 UTC, Void-995 wrote: Can somebody explain how [0] is more safe than array.ptr? Just want to understand why second statement

[Issue 18561] postblit should allow writing const/immutable members just like constructors

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18561 Steven Schveighoffer changed: What|Removed |Added Hardware|x86 |All

[Issue 18561] postblit should allow writing const/immutable members just like constructors

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18561 Steven Schveighoffer changed: What|Removed |Added Status|RESOLVED|REOPENED

Re: Why does this not compile?

2018-03-06 Thread Steven Schveighoffer via Digitalmars-d
On 3/6/18 7:44 AM, Shachar Shemesh wrote: On 06/03/18 14:00, Steven Schveighoffer wrote: On 3/6/18 6:21 AM, Simen Kjærås wrote: On Tuesday, 6 March 2018 at 10:03:54 UTC, Shachar Shemesh wrote: void main() {     struct S {     uint value;     ~this() {     }     }     const S a =

Re: Why does this not compile?

2018-03-06 Thread Simen Kjærås via Digitalmars-d
On Tuesday, 6 March 2018 at 12:00:43 UTC, Steven Schveighoffer wrote: On 3/6/18 6:21 AM, Simen Kjærås wrote: On Tuesday, 6 March 2018 at 10:03:54 UTC, Shachar Shemesh wrote: void main() {     struct S {     uint value;     ~this() {     }     }     const S a = S(12);     S b = a;

Re: Why does this not compile?

2018-03-06 Thread Steven Schveighoffer via Digitalmars-d
On 3/6/18 6:21 AM, Simen Kjærås wrote: On Tuesday, 6 March 2018 at 10:03:54 UTC, Shachar Shemesh wrote: void main() {     struct S {     uint value;     ~this() {     }     }     const S a = S(12);     S b = a; } test.d(10): Error: cannot implicitly convert expression a of type

[Issue 18561] New: postblit behaves inconsistently with constants

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18561 Issue ID: 18561 Summary: postblit behaves inconsistently with constants Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: enhancement

Re: Article: Why Const Sucks

2018-03-06 Thread Dukc via Digitalmars-d-announce
On Tuesday, 6 March 2018 at 12:05:26 UTC, Dukc wrote: I think we have a bug here. I believe postblits should behave like constructors in both events. https://issues.dlang.org/show_bug.cgi?id=18561

Re: Why does this not compile?

2018-03-06 Thread Shachar Shemesh via Digitalmars-d
On 06/03/18 14:00, Steven Schveighoffer wrote: On 3/6/18 6:21 AM, Simen Kjærås wrote: On Tuesday, 6 March 2018 at 10:03:54 UTC, Shachar Shemesh wrote: void main() {     struct S {     uint value;     ~this() {     }     }     const S a = S(12);     S b = a; } test.d(10): Error:

Re: DIP 1006 - Preliminary Review Round 1

2018-03-06 Thread Jonathan M Davis via Digitalmars-d
On Monday, March 05, 2018 02:30:12 Walter Bright via Digitalmars-d wrote: > The idea behind removal of the runtime checks is as a performance > optimization done on a debugged program. It's like turning on or off > array bounds checking. Many leave asserts and array bounds checking on > even in

[Issue 18551] Improve hint for "does not override any function

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18551 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/89243bdc93ef220f85e53d18a0c8521fc43afead Fix Issue 18551 - Improve hint for does not override any

Re: mysql-native v2.1.0

2018-03-06 Thread Martin Tschierschke via Digitalmars-d-announce
On Tuesday, 6 March 2018 at 07:39:00 UTC, aberba wrote: On Tuesday, 6 March 2018 at 04:31:42 UTC, Nick Sabalausky (Abscissa) wrote: [...] I'm not opposed to it being added, but I'm not aware of what benefit it would provide that would big enough to make it a priority. Also, AFAIK, vibe

Re: Why does this not compile?

2018-03-06 Thread Diego via Digitalmars-d
On Tuesday, 6 March 2018 at 10:03:54 UTC, Shachar Shemesh wrote: void main() { struct S { uint value; ~this() { } } const S a = S(12); S b = a; } You cannot assign a const element (`a`) to a non-const element (`b`) in `S b = a` expression. To make de

Re: DIP 1006 - Preliminary Review Round 1

2018-03-06 Thread Walter Bright via Digitalmars-d
On 3/6/2018 1:58 AM, Jonathan M Davis wrote: [...] The entire point of making assert a core language feature was so that the compiler could take advantage of it to generate better code. It's been like that for D since day 1. It has always been documented to do that. It has been discussed

Re: Article: Why Const Sucks

2018-03-06 Thread Nemanja Boric via Digitalmars-d-announce
On Tuesday, 6 March 2018 at 10:49:48 UTC, Dukc wrote: On Monday, 5 March 2018 at 10:57:35 UTC, Jonathan M Davis wrote (in the article): The problem is that the entire object must be fully initialized before the body of the postblit constructor is run. That means that any member variables which

[Issue 18561] postblit behaves inconsistently with constants

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18561 ag0ae...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 18357] can break immutable with postblit

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18357 ag0ae...@gmail.com changed: What|Removed |Added CC||ajiesk...@gmail.com --- Comment #1 from

Re: Speed of math function atan: comparison D and C++

2018-03-06 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 6 March 2018 at 17:51:54 UTC, H. S. Teoh wrote: [snip] I'm not advocating for getting *rid* of 80-bit float support, but only to make it *optional* rather than the default, as currently done in std.math. T Aren't there two issues: 1) std.math functions that cast to real to

Re: Article: Why Const Sucks

2018-03-06 Thread Jonathan M Davis via Digitalmars-d-announce
On Tuesday, March 06, 2018 09:36:43 H. S. Teoh via Digitalmars-d-announce wrote: > Andrei has said before, and probably on more than one occasion, that if > he were to redesign ranges today, one of the things he would do > differently was to change the definition of forward range so that .save >

Re: I have a patch to let lldb demangle D symbols ; help welcome to improve it

2018-03-06 Thread Luís Marques via Digitalmars-d
On Friday, 2 March 2018 at 00:17:13 UTC, Timothee Cour wrote: yes, I've fixed the issue with crashes on large symbols using a patched `demangle` ; will update code soon; but feel free to take a look at lldb side of things What version of LLVM did you base it on? On my LLVM fork for RISC-V

[Issue 17448] Move semantics cause memory corruption and cryptic bugs

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17448 --- Comment #28 from Tomer Filiba (weka) --- My point is, @safe is so constrained that it's practically unusable, so I don't consider it a viable solution for this problem. --

Re: DIP 1006 - Preliminary Review Round 1

2018-03-06 Thread 12345swordy via Digitalmars-d
On Tuesday, 6 March 2018 at 18:49:42 UTC, Paolo Invernizzi wrote: I simply don't understand why enforce or a custom check can't be used @safe code, if you want that behaviour. /Paolo Easy: the custom check itself could be wrong the custom check itself is right, but the implementation is

Advent of D

2018-03-06 Thread Jordi Gutiérrez Hermoso via Digitalmars-d
I wrote a blog post about working on Advent of Code in D. You can read it here: http://jordi.inversethought.com/blog/advent-of-d/

Re: Speed of math function atan: comparison D and C++

2018-03-06 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Mar 06, 2018 at 06:05:59PM +, jmh530 via Digitalmars-d-learn wrote: > On Tuesday, 6 March 2018 at 17:51:54 UTC, H. S. Teoh wrote: > > [snip] > > > > I'm not advocating for getting *rid* of 80-bit float support, but > > only to make it *optional* rather than the default, as currently >

can't build libuid examples

2018-03-06 Thread greatsam4sure via Digitalmars-d-learn
Try to build libuid examples get the following error. dub build, build successfully on the root folder. I will appreciate any help. Just try to build a gui app using dlang. OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved.

Re: How to use globals correctly?

2018-03-06 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Mar 06, 2018 at 11:46:04AM -0700, Jonathan M Davis via Digitalmars-d-learn wrote: > On Tuesday, March 06, 2018 18:34:34 bauss via Digitalmars-d-learn wrote: [...] > > Singletons are always smelly code tbh. > > > > Especially in D with thread-local storage. > > > > I can't think of a

Re: Advent of D

2018-03-06 Thread Patrick Schluter via Digitalmars-d
On Tuesday, 6 March 2018 at 18:09:21 UTC, Jordi Gutiérrez Hermoso wrote: I wrote a blog post about working on Advent of Code in D. You can read it here: http://jordi.inversethought.com/blog/advent-of-d/ Really nice, thank you.

Replace import expression with intrinsic

2018-03-06 Thread Kagamin via Digitalmars-d
In case it didn't get enough visibility: https://issues.dlang.org/show_bug.cgi?id=1985#c11 give your opinion. Not sure if a better disruption management is desired for a possibly low profit change, e.g. it can have a long grace period.

[Issue 17448] Move semantics cause memory corruption and cryptic bugs

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17448 --- Comment #27 from Tomer Filiba (weka) --- (In reply to Andrei Alexandrescu from comment #25) > > So... more special cases? > > That's a straight use of scope per DIP 1000, in fact the very design intent: > scope in a function

[Issue 18134] BitArray >>= broken when length % (8 * size_t.sizeof) == 0

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

[Issue 18134] BitArray >>= broken when length % (8 * size_t.sizeof) == 0

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18134 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/b211347454b70fdb5a539f3fd8bc82fcec846e70 Fix issue 18134 - BitArray right shift broken if length

Re: Article: Why Const Sucks

2018-03-06 Thread Martin Nowak via Digitalmars-d-announce
On Monday, 5 March 2018 at 17:38:52 UTC, H. S. Teoh wrote: struct Container { auto opSlice() const { static struct Result { private Container impl; private int n; // internal mutable

5000 Merged Phobos Pull Requests

2018-03-06 Thread Jack Stouffer via Digitalmars-d
Nine days ago, Phobos hit 5000 merged pull requests: https://github.com/dlang/phobos/pulls?page=201=is%3Apr+is%3Amerged+sort%3Amerged-desc=✓ Thats an average of 1.93 merged PRs per day (first PR merged on Jan 31, 2011). A huge thank you to everyone who made this happen.

Re: Release D 2.079.0

2018-03-06 Thread Martin Nowak via Digitalmars-d-announce
On Tuesday, 6 March 2018 at 12:21:41 UTC, Steven Schveighoffer wrote: That being said, I'm wondering if it wouldn't be better to have std.experimental be in its own repository. Just showing that phobos is not the right place to develop modules/packages, also mir. IMO std.experimental provides

Re: Speed of math function atan: comparison D and C++

2018-03-06 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 6 March 2018 at 18:41:15 UTC, H. S. Teoh wrote: The fix itself may be straightforward, but how to do it without breaking tons of existing code and provoking user backlash is the tricky part. [snip] Ah, I see what you're saying. People may be depending on the extra accuracy for

Re: Release D 2.079.0

2018-03-06 Thread Steven Schveighoffer via Digitalmars-d-announce
On 3/6/18 2:30 PM, Martin Nowak wrote: On Tuesday, 6 March 2018 at 12:21:41 UTC, Steven Schveighoffer wrote: But if needed, you could have your dub package depend on a prior version. http://code.dlang.org/packages/stdx-allocator ;) This is the answer, vibe.d should depend on

Re: How to use globals correctly?

2018-03-06 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, March 06, 2018 11:52:05 H. S. Teoh via Digitalmars-d-learn wrote: > On Tue, Mar 06, 2018 at 11:46:04AM -0700, Jonathan M Davis via Digitalmars-d-learn wrote: > > On Tuesday, March 06, 2018 18:34:34 bauss via Digitalmars-d-learn wrote: > [...] > > > > Singletons are always smelly code

Re: Is it possible to return the subclass from a method of the parent class in dlang?

2018-03-06 Thread Jacob Carlborg via Digitalmars-d-learn
On 2018-03-02 21:23, Christian Köstlin wrote: To give an example: class Thread { ... Thread start() {...} } class Timer : Thread { ... } void main() { // Timer timer = new Timer().start; // this does not work auto timer = new Timer().start; // because timer is of type Thread

Re: DIP 1006 - Preliminary Review Round 1

2018-03-06 Thread Paolo Invernizzi via Digitalmars-d
On Tuesday, 6 March 2018 at 17:34:08 UTC, 12345swordy wrote: On Tuesday, 6 March 2018 at 17:24:35 UTC, Jonathan M Davis wrote: On Tuesday, March 06, 2018 16:30:09 John Colvin via Digitalmars-d wrote: On Tuesday, 6 March 2018 at 02:05:58 UTC, Walter Bright wrote: > [...] So, to clarify, adding

[Issue 17448] Move semantics cause memory corruption and cryptic bugs

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17448 Jonathan M Davis changed: What|Removed |Added CC|

Re: Article: Why Const Sucks

2018-03-06 Thread Jonathan M Davis via Digitalmars-d-announce
On Tuesday, March 06, 2018 19:06:25 Martin Nowak via Digitalmars-d-announce wrote: > On Tuesday, 6 March 2018 at 18:17:58 UTC, Jonathan M Davis wrote: > > I'm not actually convinced that killing auto-decoding is really > > much better. > > I don't think the problem is auto-decoding in string

Re: DIP 1006 - Preliminary Review Round 1

2018-03-06 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, March 06, 2018 18:49:42 Paolo Invernizzi via Digitalmars-d wrote: > I simply don't understand why enforce or a custom check can't be > used @safe code, if you want that behaviour. > > If the program must HALT on this or that, well, what is better > than an explicit piece of

Re: I have a patch to let lldb demangle D symbols ; help welcome to improve it

2018-03-06 Thread Johan Engelen via Digitalmars-d
On Tuesday, 6 March 2018 at 20:25:10 UTC, Johan Engelen wrote: On Tuesday, 6 March 2018 at 18:19:13 UTC, Luís Marques wrote: On my LLVM fork for RISC-V and MSP430 work it doesn't build (no llvm/Support/DJB.h) and on the latest stable, 5.0.1, cmake fails to configure (Unknown CMake command

Re: I have a patch to let lldb demangle D symbols ; help welcome to improve it

2018-03-06 Thread Johan Engelen via Digitalmars-d
On Tuesday, 6 March 2018 at 18:19:13 UTC, Luís Marques wrote: On my LLVM fork for RISC-V and MSP430 work it doesn't build (no llvm/Support/DJB.h) and on the latest stable, 5.0.1, cmake fails to configure (Unknown CMake command "add_llvm_install_targets"). LLDB and LLVM need to be version

[Issue 18541] comparison `==` of two typeid() should always be rewritten as a "is"

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

[Issue 17448] Move semantics cause memory corruption and cryptic bugs

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17448 --- Comment #26 from Eyal --- What solution is there for this use-case then? We need objects to register themselves (i.e: set out-of-scope pointers to point at them) and RAII-wise have them de-register themselves. While they are

[Issue 1985] import expression should return ubyte[] not string

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=1985 --- Comment #11 from anonymous4 --- I think it's better to replace import expression with intrinsic, say, importText (like std.file.readText). This will also reduce grammar complexity and remove second and rarely used

[Issue 1985] import expression should return ubyte[] not string

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=1985 anonymous4 changed: What|Removed |Added Keywords||spec --

Re: Release D 2.079.0

2018-03-06 Thread Martin Nowak via Digitalmars-d-announce
On Tuesday, 6 March 2018 at 11:10:49 UTC, Atila Neves wrote: The problem with that is I was waiting for 2.079.0 since it fixes a bug that prevented me from upgrading to any of the 2.078.x releases on Windows. I think 2.078 would make an excellent starting point for a LTS because of the

[OT] Gaming Meetup

2018-03-06 Thread WebFreak001 via Digitalmars-d
Hi, I was planning on going to what is basically a LAN Party in the Netherlands near Venlo and was wondering if anyone in this community also went or would want to go. It is themed after a certain computer game called osu! which probably not a lot of you play, but it might still be a nice

[Issue 18564] core.demangle exception Range violation

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18564 johanenge...@weka.io changed: What|Removed |Added Keywords||industry CC|

[Issue 18564] core.demangle exception Range violation

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18564 johanenge...@weka.io changed: What|Removed |Added Keywords||mangling --

Re: Article: Why Const Sucks

2018-03-06 Thread Jonathan M Davis via Digitalmars-d-announce
On Tuesday, March 06, 2018 09:41:42 H. S. Teoh via Digitalmars-d-announce wrote: > As they say, hindsight is always 20/20. But it wasn't so easy to > foresee the consequences at the time when the very concept of ranges was > still brand new. Except that even worse, I'd argue that hindsight

Re: Article: Why Const Sucks

2018-03-06 Thread H. S. Teoh via Digitalmars-d-announce
On Tue, Mar 06, 2018 at 11:20:56AM -0700, Jonathan M Davis via Digitalmars-d-announce wrote: > On Tuesday, March 06, 2018 09:41:42 H. S. Teoh via Digitalmars-d-announce > wrote: > > As they say, hindsight is always 20/20. But it wasn't so easy to > > foresee the consequences at the time when

Re: mysql-native v2.1.0

2018-03-06 Thread bauss via Digitalmars-d-announce
On Tuesday, 6 March 2018 at 18:31:08 UTC, bauss wrote: On Saturday, 3 March 2018 at 07:37:38 UTC, Nick Sabalausky (Abscissa) wrote: [...] I'm unsure how I'd go about implementing prepared statements in a vibe.d application correctly. [...] Like more specifically do I still call

Re: Article: Why Const Sucks

2018-03-06 Thread H. S. Teoh via Digitalmars-d-announce
On Tue, Mar 06, 2018 at 01:31:39PM -0500, Steven Schveighoffer via Digitalmars-d-announce wrote: > On 3/6/18 10:39 AM, Jonathan M Davis wrote: > > Yeah. If you're dealing with generic code rather than a specific > > range type that you know is implicitly saved when copied, you have > > to use

Re: Article: Why Const Sucks

2018-03-06 Thread Jonathan M Davis via Digitalmars-d-announce
On Tuesday, March 06, 2018 10:47:36 H. S. Teoh via Digitalmars-d-announce wrote: > On Tue, Mar 06, 2018 at 01:31:39PM -0500, Steven Schveighoffer via Digitalmars-d-announce wrote: > > On 3/6/18 10:39 AM, Jonathan M Davis wrote: > > > Yeah. If you're dealing with generic code rather than a

Re: 5000 Merged Phobos Pull Requests

2018-03-06 Thread H. S. Teoh via Digitalmars-d
On Tue, Mar 06, 2018 at 07:21:10PM +, Jack Stouffer via Digitalmars-d wrote: > Nine days ago, Phobos hit 5000 merged pull requests: > > https://github.com/dlang/phobos/pulls?page=201=is%3Apr+is%3Amerged+sort%3Amerged-desc=✓ > > Thats an average of 1.93 merged PRs per day (first PR merged on

Re: Speed of math function atan: comparison D and C++

2018-03-06 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Mar 06, 2018 at 08:12:57AM +0100, Robert M. Münch via Digitalmars-d-learn wrote: > On 2018-03-05 20:11:06 +, H. S. Teoh said: > > > Walter has been adamant that we should always compute std.math.* > > functions with the `real` type, which on x86 maps to the non-IEEE > > 80-bit

Re: What's the proper way to add a local file dependence to dub?

2018-03-06 Thread Jacob Carlborg via Digitalmars-d-learn
On 2018-03-04 17:46, Marc wrote: then copy it to sources folder? let's say I have a small library folder at C:\mylibrary\D where I want to use dir.d from it. How do I add that file dependence to dub? But I do not want to that file be passed directly to dmd, I want to that file be copied to

[Issue 9983] inout type can not be used as a parameter for structure template

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9983 Martin Nowak changed: What|Removed |Added CC||c...@dawg.eu

Re: Release D 2.079.0

2018-03-06 Thread Martin Nowak via Digitalmars-d-announce
On Monday, 5 March 2018 at 16:18:11 UTC, Chris M. wrote: Good stuff. Still bothers me that we had to special case "throw new Exception();" in order to make it nogc. I can't think of any better ways right now Implementing EH for values (instead of class references) would have been a lot more

Re: Release D 2.079.0

2018-03-06 Thread Martin Nowak via Digitalmars-d-announce
On Tuesday, 6 March 2018 at 05:22:58 UTC, Void-995 wrote: Can somebody explain how [0] is more safe than array.ptr? Just want to understand why second statement isn't allowed in safe anymore. [0] is runtime bounds-checked array.ptr is unchecked and might return an out-of-bounds pointer (to

Re: Advent of D

2018-03-06 Thread Steven Schveighoffer via Digitalmars-d
On 3/6/18 1:09 PM, Jordi Gutiérrez Hermoso wrote: I wrote a blog post about working on Advent of Code in D. You can read it here: http://jordi.inversethought.com/blog/advent-of-d/ I'm enjoying this. One thing jumped out at me: static does not mean execute at compile time (exactly), it

Re: Article: Why Const Sucks

2018-03-06 Thread Martin Nowak via Digitalmars-d-announce
On Tuesday, 6 March 2018 at 18:17:58 UTC, Jonathan M Davis wrote: I'm not actually convinced that killing auto-decoding is really much better. I don't think the problem is auto-decoding in string range adapters, but repeated validation. https://issues.dlang.org/show_bug.cgi?id=14519#c32 If

[Issue 18561] postblit should allow writing const/immutable members just like constructors

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18561 --- Comment #4 from ajiesk...@gmail.com --- (In reply to anonymous4 from comment #3) > This passes: > --- > struct A > { > int a; > this(int b) const { a=b; } > } > int main() > { > const A a; > assert(a.a==0,"0"); > a.__ctor(1);

Re: See docs compiler message

2018-03-06 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/6/18 9:50 AM, ixid wrote: On Tuesday, 6 March 2018 at 14:37:27 UTC, Steven Schveighoffer wrote: Now, there aren't actually docs for Transposed, but you can find it if you look at std.range.transposed: https://dlang.org/phobos/std_range.html#transposed Thanks, I had found that but that

Re: Advent of D

2018-03-06 Thread Joakim via Digitalmars-d
On Tuesday, 6 March 2018 at 18:09:21 UTC, Jordi Gutiérrez Hermoso wrote: I wrote a blog post about working on Advent of Code in D. You can read it here: http://jordi.inversethought.com/blog/advent-of-d/ What's with the mammoth D blog posts lately? Nice write-up, worth sharing on reddit/HN.

[Issue 18561] postblit should allow writing const/immutable members just like constructors

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18561 --- Comment #5 from Steven Schveighoffer --- (In reply to anonymous4 from comment #3) > a.__ctor(1); This is another bug. One should only be able to call const __ctor on a struct once, before using it. --

Re: Profiling after exit()

2018-03-06 Thread Martin Nowak via Digitalmars-d-learn
On Thursday, 27 July 2017 at 15:16:35 UTC, Eugene Wissner wrote: Are there profilers that work well with dmd? valgrind? OProfile? Yes, any sampling profiler works fine, e.g. perf on linux, Intel VTune/AMD CodeXL on Windows. Those directly monitor CPU performance counters and have a

Fetch and pre-build dub dependencies

2018-03-06 Thread Tamas via Digitalmars-d
I have a Dockerfile to build a vibe.d project. Docker has a nice caching system so it continues building the docker image from the step where it's needed when something changes. This is typically at the step of adding my source files, then building the binary. The problem is that fetching and

[Issue 18561] postblit should allow writing const/immutable members just like constructors

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18561 --- Comment #3 from anonymous4 --- This passes: --- struct A { int a; this(int b) const { a=b; } } int main() { const A a; assert(a.a==0,"0"); a.__ctor(1); assert(a.a==1,"1"); return 0; } --- --

Re: How to use globals correctly?

2018-03-06 Thread bauss via Digitalmars-d-learn
On Monday, 5 March 2018 at 19:51:33 UTC, Steven Schveighoffer wrote: On 3/5/18 2:25 PM, Marc wrote: Can __gshared be used instead of static in the singleton pattern? I, comming from C++, ignorantly, have never used _gshared so I went to static instead of (being static also means

Re: Article: Why Const Sucks

2018-03-06 Thread Steven Schveighoffer via Digitalmars-d-announce
On 3/6/18 10:39 AM, Jonathan M Davis wrote: Yeah. If you're dealing with generic code rather than a specific range type that you know is implicitly saved when copied, you have to use save so often that it's painful, and almost no one does it. e.g. equal(lhs.save, rhs.save) or immutable

Re: mysql-native v2.1.0

2018-03-06 Thread bauss via Digitalmars-d-announce
On Saturday, 3 March 2018 at 07:37:38 UTC, Nick Sabalausky (Abscissa) wrote: An all-D MySQL/MariaDB client library: https://github.com/mysql-d/mysql-native == Tagged 'v2.1.0', which mainly adds a few new features, including greatly simplified shortcut

Re: Advent of D

2018-03-06 Thread David Gileadi via Digitalmars-d
On 3/6/18 11:09 AM, Jordi Gutiérrez Hermoso wrote: I wrote a blog post about working on Advent of Code in D. You can read it here: http://jordi.inversethought.com/blog/advent-of-d/ I really enjoyed this. Thank you!

Re: How to use globals correctly?

2018-03-06 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, March 06, 2018 18:34:34 bauss via Digitalmars-d-learn wrote: > On Monday, 5 March 2018 at 19:51:33 UTC, Steven Schveighoffer > > wrote: > > On 3/5/18 2:25 PM, Marc wrote: > >> Can __gshared be used instead of static in the singleton > >> pattern? I, comming from C++, ignorantly, have

Re: mysql-native v2.1.0

2018-03-06 Thread bauss via Digitalmars-d-announce
On Tuesday, 6 March 2018 at 18:36:45 UTC, bauss wrote: On Tuesday, 6 March 2018 at 18:31:08 UTC, bauss wrote: On Saturday, 3 March 2018 at 07:37:38 UTC, Nick Sabalausky (Abscissa) wrote: [...] I'm unsure how I'd go about implementing prepared statements in a vibe.d application correctly.

[Issue 18564] New: core.demangle exception Range violation

2018-03-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18564 Issue ID: 18564 Summary: core.demangle exception Range violation Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority:

Setting executable's information by resources

2018-03-06 Thread Marc via Digitalmars-d-learn
I'm trying to use this resource to set executable's information/metadata but it fail to set anything but the icon, without any error message. Could anyone point out if there's anything wrong with my approach? (if anyone use a different approach/toolset to set those data, your suggestion is

[Issue 18563] context pointer inside structs constness problems

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

Re: DIP 1006 - Preliminary Review Round 1

2018-03-06 Thread Timon Gehr via Digitalmars-d
On 06.03.2018 11:17, Walter Bright wrote: On 3/6/2018 1:58 AM, Jonathan M Davis wrote: [...] The entire point of making assert a core language feature was so that the compiler could take advantage of it to generate better code. It does not need to be a core language feature for that. It

Re: Advent of D

2018-03-06 Thread JN via Digitalmars-d
On Tuesday, 6 March 2018 at 18:09:21 UTC, Jordi Gutiérrez Hermoso wrote: I wrote a blog post about working on Advent of Code in D. You can read it here: http://jordi.inversethought.com/blog/advent-of-d/ on Day 8, I think the original "verbose" code is better in the end. Mixin at least for

Re: Advent of D

2018-03-06 Thread Jordi Gutiérrez Hermoso via Digitalmars-d
On Tuesday, 6 March 2018 at 21:03:47 UTC, JN wrote: On Tuesday, 6 March 2018 at 18:09:21 UTC, Jordi Gutiérrez Hermoso wrote: I wrote a blog post about working on Advent of Code in D. You can read it here: http://jordi.inversethought.com/blog/advent-of-d/ on Day 8, I think the original

Re: Advent of D

2018-03-06 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 6 March 2018 at 21:09:06 UTC, Jordi Gutiérrez Hermoso wrote: I did post it to Lobsters, though: This is random but I have been thinking about asking for a lobsters invite... can you hook me up?

Vtable for virtual functions in D

2018-03-06 Thread Henrik via Digitalmars-d
Does anyone know if D is using the vtable implementation for virtual functions just like most C++ compilers? If yes, can someone explain the advantages of this strategy? A function pointer in C is regarded as expensive because of missing inlining, but a double indirection through a vtable just

  1   2   >