Re: How does one get to the root of a package in ddox?

2016-04-15 Thread Sönke Ludwig via Digitalmars-d
Am 16.04.2016 um 07:38 schrieb Sönke Ludwig: Am 15.04.2016 um 22:38 schrieb Andrei Alexandrescu: Say you're on https://dlang.org/library/std/range/primitives.html and try to find your way to https://dlang.org/library/std/range.html. Clicking on "range" in the navigation panel doesn't help - it

Re: How does one get to the root of a package in ddox?

2016-04-15 Thread Sönke Ludwig via Digitalmars-d
Am 15.04.2016 um 22:38 schrieb Andrei Alexandrescu: Say you're on https://dlang.org/library/std/range/primitives.html and try to find your way to https://dlang.org/library/std/range.html. Clicking on "range" in the navigation panel doesn't help - it just collapses/expands the tree branch.

[Issue 15864] chmgen triggers exception in std.regex

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15864 --- Comment #6 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/25d81e662dda16d43fecfec1e0f9e4026ee5ba82 Fix issue 15864 - chmgen triggers exception in

[Issue 12625] implicit slicing of RValue static array should be illegal

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12625 --- Comment #15 from Jonathan M Davis --- Related: issue# 15932 --

Re: What is going on in this code?

2016-04-15 Thread Jonathan M Davis via Digitalmars-d
On Friday, April 15, 2016 21:16:44 Jonathan M Davis via Digitalmars-d wrote: > On Thursday, April 14, 2016 09:31:25 Steven Schveighoffer via Digitalmars-d > > wrote: > > That is awful. > > > > I propose we make slicing such a return value implicitly an error. I > > can't think of a valid reason

[Issue 8838] Slicing static arrays should be considered unsafe (@system)

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=8838 --- Comment #15 from Jonathan M Davis --- Related: issue# 15932 --

[Issue 15932] New: Get rid of the implicit slicing of static arrays

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15932 Issue ID: 15932 Summary: Get rid of the implicit slicing of static arrays Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement

Re: What is going on in this code?

2016-04-15 Thread Jonathan M Davis via Digitalmars-d
On Thursday, April 14, 2016 09:31:25 Steven Schveighoffer via Digitalmars-d wrote: > That is awful. > > I propose we make slicing such a return value implicitly an error. I > can't think of a valid reason for allowing it. > > I'm not the only one: https://issues.dlang.org/show_bug.cgi?id=12625

Re: Who wore it better?

2016-04-15 Thread Jonathan M Davis via Digitalmars-d
On Friday, April 15, 2016 13:46:24 Andrei Alexandrescu via Digitalmars-d wrote: > On 04/15/2016 01:31 PM, Namespace wrote: > > Since it is a template: Why these attributes: @trusted pure nothrow ? > > @trusted is not inferrable, the others are type-independent and nice for > the documentation. --

Using D in Android App

2016-04-15 Thread Justice via Digitalmars-d-learn
Is it difficult to create a D business like app and connect it to android through java for the interface? I'd rather create all the complex stuff in D and either use it natively through java(I need a UI). If it is workable, can the same be said for IOS(just recompile the D source to the IOS

Re: Dead link finding automation

2016-04-15 Thread Vladimir Panteleev via Digitalmars-d
On Saturday, 16 April 2016 at 01:13:24 UTC, Andrei Alexandrescu wrote: On 04/15/2016 08:38 PM, Vladimir Panteleev wrote: The macros we use in our documentation are not meant for the URL structure that DDox uses. This incompatibility creates broken links. Can we build ddox with specific

Re: Recursive vs. iterative constraints

2016-04-15 Thread Jonathan M Davis via Digitalmars-d
On Friday, April 15, 2016 22:42:55 Andrei Alexandrescu via Digitalmars-d wrote: > So the constraint on chain() is: > > Ranges.length > 0 && > allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)) && > !is(CommonType!(staticMap!(ElementType, staticMap!(Unqual, Ranges))) == > void) > > Noice. Now,

Re: Recursive vs. iterative constraints

2016-04-15 Thread Alex Parrill via Digitalmars-d
On Saturday, 16 April 2016 at 02:42:55 UTC, Andrei Alexandrescu wrote: So the constraint on chain() is: Ranges.length > 0 && allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)) && !is(CommonType!(staticMap!(ElementType, staticMap!(Unqual, Ranges))) == void) Noice. Now, an alternative is to

Recursive vs. iterative constraints

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
So the constraint on chain() is: Ranges.length > 0 && allSatisfy!(isInputRange, staticMap!(Unqual, Ranges)) && !is(CommonType!(staticMap!(ElementType, staticMap!(Unqual, Ranges))) == void) Noice. Now, an alternative is to express it as a recursive constraint: (Ranges.length == 1 &&

Re: Who wore it better?

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
On 04/15/2016 05:27 PM, Steven Schveighoffer wrote: On 4/15/16 5:01 PM, Andrei Alexandrescu wrote: On 04/15/2016 04:45 PM, Steven Schveighoffer wrote: On 4/15/16 4:34 PM, Andrei Alexandrescu wrote: On 04/15/2016 04:16 PM, Steven Schveighoffer wrote: If you find such advertisement useless,

Re: Dead link finding automation

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
On 04/15/2016 08:38 PM, Vladimir Panteleev wrote: External links are a different issue. They can't be tested in the autotester (at least not fail the build), otherwise a site we link to going (temporarily) down means our master is broken. They would need special treatment, e.g. report them as

Re: Dead link finding automation

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
On 04/15/2016 08:38 PM, Vladimir Panteleev wrote: The macros we use in our documentation are not meant for the URL structure that DDox uses. This incompatibility creates broken links. Can we build ddox with specific macros? We use that technique with latex etc. -- Andrei

Re: On the origins of github.com/D-Programming-Language

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
On 04/15/2016 08:06 PM, Vladimir Panteleev wrote: On Friday, 15 April 2016 at 06:11:22 UTC, Vladimir Panteleev wrote: Assuming no objections, I'll do the move tomorrow, around 2016-04-16 00:00 UTC. Done. Speak up if anything seems broken or wrong. Many thanks, Vladimir! -- Andrei

RefCounted / DMD bug

2016-04-15 Thread Erik Smith via Digitalmars-d
I'm getting a strange assertion/crash involving RefCounted and I've reduced it down to the isolated case (see below). This is with D 2.071 and requires this version to compile. I'm wondering if there is something I wrong in the way I'm using RefCounted. I'm using using it to pass RC value

Re: On the origins of github.com/D-Programming-Language

2016-04-15 Thread Brad Roberts via Digitalmars-d
On 4/15/16 5:06 PM, Vladimir Panteleev via Digitalmars-d wrote: On Friday, 15 April 2016 at 06:11:22 UTC, Vladimir Panteleev wrote: Assuming no objections, I'll do the move tomorrow, around 2016-04-16 00:00 UTC. Done. Speak up if anything seems broken or wrong. I've updated the auto-tester

Re: Dead link finding automation

2016-04-15 Thread Brad Roberts via Digitalmars-d
On 4/15/16 5:38 PM, Vladimir Panteleev via Digitalmars-d wrote: On Friday, 15 April 2016 at 18:25:58 UTC, Andrei Alexandrescu wrote: Can we automate stuff like https://issues.dlang.org/show_bug.cgi?id=15929? There are quite a few tools around, not to mention we could easily roll our own. Who'd

Re: Dead link finding automation

2016-04-15 Thread Vladimir Panteleev via Digitalmars-d
On Friday, 15 April 2016 at 18:25:58 UTC, Andrei Alexandrescu wrote: Can we automate stuff like https://issues.dlang.org/show_bug.cgi?id=15929? There are quite a few tools around, not to mention we could easily roll our own. Who'd like to take this project? Thx! -- Andrei It's something I've

[Issue 9580] std.variant.Algebraic with Tuple format problem

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=9580 Simen Kjaeraas changed: What|Removed |Added CC|

Free paperback: "Programming in D" by Ali Çehreli. You pick up in San Francisco

2016-04-15 Thread throwaway389012 via Digitalmars-d-learn
Free paperback of "Programming in D" by Ali Çehreli. You'll pick it up in San Francisco. It's a great book, but I prefer to read it in electronic form. Send a message to the account "throwaway389012" on Reddit if you want it. Leave your phone number or email address. If you don't hear

Re: On the origins of github.com/D-Programming-Language

2016-04-15 Thread Vladimir Panteleev via Digitalmars-d
On Saturday, 16 April 2016 at 00:14:46 UTC, Steven Schveighoffer wrote: BTW, do I need to be a member of the redirect group? I was asked to join, but I think it may not matter. Yeah, I indeed don't think it matters. In fact that group should probably have as few people as possible, to avoid

[Issue 15931] The compiler lets you try to derive from a const, immutable, or inout, shared class

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15931 Jonathan M Davis changed: What|Removed |Added Keywords|

[Issue 15931] New: The compiler lets you try to derive from a const, immutable, or inout, shared class

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15931 Issue ID: 15931 Summary: The compiler lets you try to derive from a const, immutable, or inout, shared class Product: D Version: D2 Hardware: All OS: All

Re: Is this a bug?

2016-04-15 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, April 16, 2016 00:28:46 ag0aep6g via Digitalmars-d-learn wrote: > On 15.04.2016 20:55, Eric wrote: > > 13 class C : const (I!(J)) > > I think this const is ignored by the compiler. It's definitely ignored, and I'd argue that it's a bug in the compiler that it's even accepted.

Re: On the origins of github.com/D-Programming-Language

2016-04-15 Thread Steven Schveighoffer via Digitalmars-d
On 4/15/16 8:13 PM, Vladimir Panteleev wrote: On Saturday, 16 April 2016 at 00:11:53 UTC, Steven Schveighoffer wrote: On 4/15/16 8:06 PM, Vladimir Panteleev wrote: On Friday, 15 April 2016 at 06:11:22 UTC, Vladimir Panteleev wrote: Assuming no objections, I'll do the move tomorrow, around

Re: On the origins of github.com/D-Programming-Language

2016-04-15 Thread Vladimir Panteleev via Digitalmars-d
On Saturday, 16 April 2016 at 00:11:53 UTC, Steven Schveighoffer wrote: On 4/15/16 8:06 PM, Vladimir Panteleev wrote: On Friday, 15 April 2016 at 06:11:22 UTC, Vladimir Panteleev wrote: Assuming no objections, I'll do the move tomorrow, around 2016-04-16 00:00 UTC. Done. Speak up if

Re: On the origins of github.com/D-Programming-Language

2016-04-15 Thread Steven Schveighoffer via Digitalmars-d
On 4/15/16 8:06 PM, Vladimir Panteleev wrote: On Friday, 15 April 2016 at 06:11:22 UTC, Vladimir Panteleev wrote: Assuming no objections, I'll do the move tomorrow, around 2016-04-16 00:00 UTC. Done. Speak up if anything seems broken or wrong. This is awesome! Makes me want to delete and

Re: On the origins of github.com/D-Programming-Language

2016-04-15 Thread Vladimir Panteleev via Digitalmars-d
On Friday, 15 April 2016 at 06:11:22 UTC, Vladimir Panteleev wrote: Assuming no objections, I'll do the move tomorrow, around 2016-04-16 00:00 UTC. Done. Speak up if anything seems broken or wrong.

Re: Accessing __FILE__ and __LINE__ of caller in combination with varargs?

2016-04-15 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, April 15, 2016 20:52:42 WebFreak001 via Digitalmars-d-learn wrote: > On Friday, 15 April 2016 at 20:43:08 UTC, pineapple wrote: > > I've written a very handy assertf method whose signature looks > > like this: > > > > void assertf(Args...)(lazy bool condition, in string message, > >

[Issue 12625] implicit slicing of RValue static array should be illegal

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12625 --- Comment #14 from Jonathan M Davis --- (In reply to ZombineDev from comment #12) > Just to clarify - I'm talking about OP case. Slicing static arrays in > general can be @safe with enough escape analysis - e.g. when

perfect hash map in visual D

2016-04-15 Thread Basile.B via Digitalmars-d
https://github.com/BBasile/IsItThere https://issues.dlang.org/show_bug.cgi?id=15901 when you want bro ;)

Re: So what does (inout int = 0) do?

2016-04-15 Thread Steven Schveighoffer via Digitalmars-d
On 4/15/16 6:31 PM, Timon Gehr wrote: On 15.04.2016 23:56, Steven Schveighoffer wrote: Impossible or difficult to do with the current implementation? ... What I'm saying is that the check that is currently implemented is not adequate for the new case. This is not terribly important though.

Re: So what does (inout int = 0) do?

2016-04-15 Thread Timon Gehr via Digitalmars-d
On 15.04.2016 23:56, Steven Schveighoffer wrote: On 4/15/16 5:17 PM, Timon Gehr wrote: On 15.04.2016 22:47, Steven Schveighoffer wrote: There's no difference between a function that declares its variables inout within its parameters or one that declares them locally. ... Yes, there is.

Re: Is this a bug?

2016-04-15 Thread ag0aep6g via Digitalmars-d-learn
On 15.04.2016 20:55, Eric wrote: 13 class C : const (I!(J)) I think this const is ignored by the compiler. 15F!(J) m; A little tip: You can omit the parentheses of template instantiations when the argument is a single identifier. That is, `F!(J)` can be written as `F!J`.

[Issue 15924] formattedWrite doesn't write to empty appender

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15924 --- Comment #3 from ag0ae...@gmail.com --- (In reply to keepitsimplesirius from comment #2) > Thanks for explanation. What about making formattedWrite to take argument by > reference instead of value? That would make your code work, but it would

Re: So what does (inout int = 0) do?

2016-04-15 Thread Steven Schveighoffer via Digitalmars-d
On 4/15/16 5:17 PM, Timon Gehr wrote: On 15.04.2016 22:47, Steven Schveighoffer wrote: There's no difference between a function that declares its variables inout within its parameters or one that declares them locally. ... Yes, there is. Semantic analysis sees the parameter types before it

Re: Who wore it better?

2016-04-15 Thread Steven Schveighoffer via Digitalmars-d
On 4/15/16 5:01 PM, Andrei Alexandrescu wrote: On 04/15/2016 04:45 PM, Steven Schveighoffer wrote: On 4/15/16 4:34 PM, Andrei Alexandrescu wrote: On 04/15/2016 04:16 PM, Steven Schveighoffer wrote: If you find such advertisement useless, you of course do not need inout or const. Let's not

Re: So what does (inout int = 0) do?

2016-04-15 Thread Timon Gehr via Digitalmars-d
On 15.04.2016 23:03, Andrei Alexandrescu wrote: On 04/15/2016 04:47 PM, Steven Schveighoffer wrote: There's no difference between a function that declares its variables inout within its parameters or one that declares them locally. So now we get to things like: void fun() { inout int

Re: So what does (inout int = 0) do?

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
On 04/15/2016 05:17 PM, Timon Gehr wrote: Well, that is precisely the way that languages with real type systems address issues like this one. D has many others like it. Note that for type systems, complexity and expressiveness do not necessarily correlate. Nicely put on both counts. (Well

Re: So what does (inout int = 0) do?

2016-04-15 Thread Timon Gehr via Digitalmars-d
On 15.04.2016 22:47, Steven Schveighoffer wrote: On 4/15/16 4:27 PM, Timon Gehr wrote: On 15.04.2016 22:03, Steven Schveighoffer wrote: On 4/15/16 3:48 PM, Timon Gehr wrote: On 15.04.2016 17:22, Steven Schveighoffer wrote: On 4/14/16 11:10 PM, Andrei Alexandrescu wrote: Consider:

Re: Accessing __FILE__ and __LINE__ of caller in combination with varargs?

2016-04-15 Thread pineapple via Digitalmars-d-learn
On Friday, 15 April 2016 at 20:52:42 UTC, WebFreak001 wrote: void assertf(string file = __FILE__, size_t line = __LINE__, Args...)(lazy bool condition, in string message, Args args) { Aha, you are the best. Thanks!

Re: Who wore it better?

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
On 04/15/2016 04:47 PM, Marco Leise wrote: Am Fri, 15 Apr 2016 14:48:26 -0400 schrieb Andrei Alexandrescu : On 4/15/16 2:46 PM, Steven Schveighoffer wrote: On 4/15/16 1:24 PM, Andrei Alexandrescu wrote: auto overlap(T, U)(T[] r1, U[] r2) @trusted pure nothrow

Re: So what does (inout int = 0) do?

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
On 04/15/2016 04:47 PM, Steven Schveighoffer wrote: There's no difference between a function that declares its variables inout within its parameters or one that declares them locally. So now we get to things like: void fun() { inout int ohHello = 42; ... } How to explain such a

Re: Who wore it better?

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
On 04/15/2016 04:45 PM, Steven Schveighoffer wrote: On 4/15/16 4:34 PM, Andrei Alexandrescu wrote: On 04/15/2016 04:16 PM, Steven Schveighoffer wrote: If you find such advertisement useless, you of course do not need inout or const. Let's not exaggerate by putting them together. -- Andrei

Re: Accessing __FILE__ and __LINE__ of caller in combination with varargs?

2016-04-15 Thread WebFreak001 via Digitalmars-d-learn
On Friday, 15 April 2016 at 20:43:08 UTC, pineapple wrote: I've written a very handy assertf method whose signature looks like this: void assertf(Args...)(lazy bool condition, in string message, Args args) But I'd also like to access the caller's file and line to use them in constructing a

Re: So what does (inout int = 0) do?

2016-04-15 Thread Steven Schveighoffer via Digitalmars-d
On 4/15/16 4:27 PM, Timon Gehr wrote: On 15.04.2016 22:03, Steven Schveighoffer wrote: On 4/15/16 3:48 PM, Timon Gehr wrote: On 15.04.2016 17:22, Steven Schveighoffer wrote: On 4/14/16 11:10 PM, Andrei Alexandrescu wrote: Consider:

Re: Who wore it better?

2016-04-15 Thread Marco Leise via Digitalmars-d
Am Fri, 15 Apr 2016 14:48:26 -0400 schrieb Andrei Alexandrescu : > On 4/15/16 2:46 PM, Steven Schveighoffer wrote: > > On 4/15/16 1:24 PM, Andrei Alexandrescu wrote: > >> auto overlap(T, U)(T[] r1, U[] r2) @trusted pure nothrow > >> if (is(typeof(r1.ptr < r2.ptr)

Re: Who wore it better?

2016-04-15 Thread Steven Schveighoffer via Digitalmars-d
On 4/15/16 4:34 PM, Andrei Alexandrescu wrote: On 04/15/2016 04:16 PM, Steven Schveighoffer wrote: If you find such advertisement useless, you of course do not need inout or const. Let's not exaggerate by putting them together. -- Andrei This is not an exaggeration. inout and const have

Accessing __FILE__ and __LINE__ of caller in combination with varargs?

2016-04-15 Thread pineapple via Digitalmars-d-learn
I've written a very handy assertf method whose signature looks like this: void assertf(Args...)(lazy bool condition, in string message, Args args) But I'd also like to access the caller's file and line to use them in constructing a thrown AssertError, and I'm stumbling on how I can get

How does one get to the root of a package in ddox?

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
Say you're on https://dlang.org/library/std/range/primitives.html and try to find your way to https://dlang.org/library/std/range.html. Clicking on "range" in the navigation panel doesn't help - it just collapses/expands the tree branch. What's the design here? Thanks, Andrei

Re: Who wore it better?

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
On 04/15/2016 04:16 PM, Steven Schveighoffer wrote: If you find such advertisement useless, you of course do not need inout or const. Let's not exaggerate by putting them together. -- Andrei

Re: So what does (inout int = 0) do?

2016-04-15 Thread Timon Gehr via Digitalmars-d
On 15.04.2016 22:03, Steven Schveighoffer wrote: On 4/15/16 3:48 PM, Timon Gehr wrote: On 15.04.2016 17:22, Steven Schveighoffer wrote: On 4/14/16 11:10 PM, Andrei Alexandrescu wrote: Consider: https://github.com/D-Programming-Language/phobos/blob/master/std/range/primitives.d#L152 It

Re: So what does (inout int = 0) do?

2016-04-15 Thread Steven Schveighoffer via Digitalmars-d
On 4/15/16 4:08 PM, Andrei Alexandrescu wrote: On 04/15/2016 04:03 PM, Steven Schveighoffer wrote: I have a way to make this work. This is actually the most major sticking point in inout. The only correct thing is to keep is that globals/static variables cannot be typed inout. Another

Re: Who wore it better?

2016-04-15 Thread Steven Schveighoffer via Digitalmars-d
On 4/15/16 4:05 PM, Andrei Alexandrescu wrote: On 04/15/2016 03:13 PM, Steven Schveighoffer wrote: On 4/15/16 2:48 PM, Andrei Alexandrescu wrote: On 4/15/16 2:46 PM, Steven Schveighoffer wrote: inout(T)[] overlap(T)(inout(T)[] r1, inout(T)[] r2) @trusted pure nothrow { import

Re: So what does (inout int = 0) do?

2016-04-15 Thread Steven Schveighoffer via Digitalmars-d
On 4/15/16 4:03 PM, Andrei Alexandrescu wrote: On 04/15/2016 03:44 PM, Steven Schveighoffer wrote: I assure you, these limitations were self-imposed. I insisted on them, without realizing that they would cause problems with generic code. I thought they would be good "lint" detection.

Re: So what does (inout int = 0) do?

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
On 04/15/2016 04:03 PM, Steven Schveighoffer wrote: I have a way to make this work. This is actually the most major sticking point in inout. The only correct thing is to keep is that globals/static variables cannot be typed inout. Another special case? The only correct thing is to simplify

Re: Who wore it better?

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
On 04/15/2016 03:13 PM, Steven Schveighoffer wrote: On 4/15/16 2:48 PM, Andrei Alexandrescu wrote: On 4/15/16 2:46 PM, Steven Schveighoffer wrote: inout(T)[] overlap(T)(inout(T)[] r1, inout(T)[] r2) @trusted pure nothrow { import std.algorithm: min, max; auto b = max(r1.ptr, r2.ptr);

Re: So what does (inout int = 0) do?

2016-04-15 Thread Steven Schveighoffer via Digitalmars-d
On 4/15/16 3:48 PM, Timon Gehr wrote: On 15.04.2016 17:22, Steven Schveighoffer wrote: On 4/14/16 11:10 PM, Andrei Alexandrescu wrote: Consider: https://github.com/D-Programming-Language/phobos/blob/master/std/range/primitives.d#L152 It works around a limitation of inout that isn't

Re: So what does (inout int = 0) do?

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
On 04/15/2016 03:44 PM, Steven Schveighoffer wrote: No, because it's not sound. you cannot cast to const through 2+ indirections. However inout works there. That is correct, a classic... thanks for getting me straight. I think the point of Kenji's argument is that inout's current limitations

Re: So what does (inout int = 0) do?

2016-04-15 Thread Timon Gehr via Digitalmars-d
On 15.04.2016 17:22, Steven Schveighoffer wrote: On 4/14/16 11:10 PM, Andrei Alexandrescu wrote: Consider: https://github.com/D-Programming-Language/phobos/blob/master/std/range/primitives.d#L152 It works around a limitation of inout that isn't necessary (even though I thought it was being

Re: So what does (inout int = 0) do?

2016-04-15 Thread Steven Schveighoffer via Digitalmars-d
On 4/15/16 3:28 PM, Andrei Alexandrescu wrote: On 4/15/16 2:39 PM, Steven Schveighoffer wrote: On 4/15/16 1:11 PM, Andrei Alexandrescu wrote: Would it be difficult to make it work without inout? T[] dup(T)(T[] arr) this should be doable. Problem is, you get identical instantiations for

[Issue 15924] formattedWrite doesn't write to empty appender

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15924 --- Comment #2 from keepitsimplesir...@gmail.com --- Thanks for explanation. What about making formattedWrite to take argument by reference instead of value? --

Re: So what does (inout int = 0) do?

2016-04-15 Thread Dmitry Olshansky via Digitalmars-d
On 15-Apr-2016 08:38, Andrei Alexandrescu wrote: On 04/15/2016 12:23 AM, Jonathan M Davis via Digitalmars-d wrote: On Thursday, April 14, 2016 23:10:12 Andrei Alexandrescu via Digitalmars-d wrote: [snip] - Jonathan M Davis I think we should deprecate inout. For real. It costs way too much

Re: DMD internal: appendToModuleMember performance

2016-04-15 Thread David Nadlinger via Digitalmars-d
On Friday, 15 April 2016 at 18:33:44 UTC, Johan Engelen wrote: Hi all, When building a unittest case in Weka.io's codebase, I measure that appendToModuleMember takes about 10% of the total compile time, and about 25% of total semantic analysis time. "appendToModuleMember" is the only

Re: So what does (inout int = 0) do?

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
On 4/15/16 2:39 PM, Steven Schveighoffer wrote: On 4/15/16 1:11 PM, Andrei Alexandrescu wrote: On 04/15/2016 12:19 PM, Kenji Hara via Digitalmars-d wrote: Didn't you use array.dup until now? It's a good example to handle qualifiers with inout. Would it be difficult to make it work without

[Issue 15928] chain(r1, r2, r3, ...) should discard all arguments after the first infinite range

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15928 --- Comment #3 from Marc Schütz --- Ah... I now remember the restriction that infinite ranges cannot be bidirectional. I think this was a conscious decision in order to get a simpler range hierarchy, but there was no fundamental

[Issue 15911] undefined __Unwind_GetIPInfo for x86_64

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15911 Jacob Carlborg changed: What|Removed |Added CC||d...@me.com --- Comment #2

Re: De Facto standard for D programming language

2016-04-15 Thread jmh530 via Digitalmars-d-learn
On Friday, 15 April 2016 at 18:41:23 UTC, Ali Çehreli wrote: Having said that, there are some omissions of how some features interact. I think it is a fantastic resource and have made much use out of it. I hope you keep updating it. It just happens that there are always some random

Re: Opportunity: Software Execution Time Determinism

2016-04-15 Thread Nordlöw via Digitalmars-d
On Friday, 15 April 2016 at 04:01:16 UTC, Walter Bright wrote: Yeah, I'd like to see a proposal from Per who actually works in the field. Do you mean DIP? Are there anything else that's unclear about the needs of my company?

Re: Who wore it better?

2016-04-15 Thread Steven Schveighoffer via Digitalmars-d
On 4/15/16 2:48 PM, Andrei Alexandrescu wrote: On 4/15/16 2:46 PM, Steven Schveighoffer wrote: inout(T)[] overlap(T)(inout(T)[] r1, inout(T)[] r2) @trusted pure nothrow { import std.algorithm: min, max; auto b = max(r1.ptr, r2.ptr); auto e = min(r1.ptr + r1.length, r2.ptr +

[Issue 15930] New: min/max of pointers violates const

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15930 Issue ID: 15930 Summary: min/max of pointers violates const Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1

Re: Is this a bug?

2016-04-15 Thread Eric via Digitalmars-d-learn
On Friday, 15 April 2016 at 18:28:58 UTC, Eric wrote: line 6 can be fixed like this: "const I!(J) i = a;" Now if I can just figure out how to fix line 15... This works: 1 alias J = const C; 2 3 void main(string[] args) 4 { 5 J a = new C(); 6 const (I!(J)) i = a; 7 } 8

Re: Any usable SIMD implementation?

2016-04-15 Thread jmh530 via Digitalmars-d
On Tuesday, 12 April 2016 at 10:55:18 UTC, xenon325 wrote: Have you seen how GCC's function multiversioning [1] ? I've been thinking about the gcc multiversioning since you mentioned it previously. I keep thinking about how the optimal algorithm for something like matrix multiplication

Re: So what does (inout int = 0) do?

2016-04-15 Thread deadalnix via Digitalmars-d
On Friday, 15 April 2016 at 12:54:11 UTC, ixid wrote: On Friday, 15 April 2016 at 03:10:12 UTC, Andrei Alexandrescu wrote: We want Phobos to be beautiful, a prime example of good D code. Admittedly, it also needs to be very general and efficient, which sometimes gets in the way. But we cannot

Re: Who wore it better?

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
On 4/15/16 2:46 PM, Steven Schveighoffer wrote: On 4/15/16 1:24 PM, Andrei Alexandrescu wrote: I grepped phobos for "inout" and picked a heavy one. Not even cherry picking here. You be the judges. Before: inout(T)[] overlap(T)(inout(T)[] r1, inout(T)[] r2) @trusted pure nothrow { alias U

Re: Who wore it better?

2016-04-15 Thread Steven Schveighoffer via Digitalmars-d
On 4/15/16 1:24 PM, Andrei Alexandrescu wrote: I grepped phobos for "inout" and picked a heavy one. Not even cherry picking here. You be the judges. Before: inout(T)[] overlap(T)(inout(T)[] r1, inout(T)[] r2) @trusted pure nothrow { alias U = inout(T); static U* max(U* a, U* b)

Re: De Facto standard for D programming language

2016-04-15 Thread Ali Çehreli via Digitalmars-d-learn
On 04/15/2016 11:19 AM, jmh530 wrote: > On Friday, 15 April 2016 at 17:51:41 UTC, Napster wrote: >> I would like to start learning the De Facto standard. which book or >> document would you use? >> >> http://erdani.com/index.php/books/tdpl/ >> >> or >> >> https://dlang.org/spec/intro.html >> >>

Re: De Facto standard for D programming language

2016-04-15 Thread Ali Çehreli via Digitalmars-d-learn
On 04/15/2016 11:31 AM, Napster wrote: I am writing a survey paper about D programming language. I want to use De Facto standard in my paper. I am not sure which one is? Both look the same. https://dlang.org/spec/intro.html is it. TDPL is behind some of D changes at this point. Ali

Re: So what does (inout int = 0) do?

2016-04-15 Thread Steven Schveighoffer via Digitalmars-d
On 4/15/16 1:11 PM, Andrei Alexandrescu wrote: On 04/15/2016 12:19 PM, Kenji Hara via Digitalmars-d wrote: Didn't you use array.dup until now? It's a good example to handle qualifiers with inout. Would it be difficult to make it work without inout? T[] dup(T)(T[] arr) this should be

Re: De Facto standard for D programming language

2016-04-15 Thread Napster via Digitalmars-d-learn
On Friday, 15 April 2016 at 18:19:44 UTC, jmh530 wrote: On Friday, 15 April 2016 at 17:51:41 UTC, Napster wrote: I would like to start learning the De Facto standard. which book or document would you use? http://erdani.com/index.php/books/tdpl/ or https://dlang.org/spec/intro.html which

DMD internal: appendToModuleMember performance

2016-04-15 Thread Johan Engelen via Digitalmars-d
Hi all, When building a unittest case in Weka.io's codebase, I measure that appendToModuleMember takes about 10% of the total compile time, and about 25% of total semantic analysis time. "appendToModuleMember" is the only function that pops up in profiling with such a large time fraction

Re: Is this a bug?

2016-04-15 Thread Eric via Digitalmars-d-learn
On Friday, 15 April 2016 at 18:22:02 UTC, Eric wrote: On Friday, 15 April 2016 at 17:43:59 UTC, ag0aep6g wrote: On 15.04.2016 19:13, Eric wrote: 1 alias J = const C; 2 3 void main(string[] args) 4 { 5 J a = new C(); 6 I!(J) i = a; 7 } 8 9 interface I(V) { }

Re: So what does (inout int = 0) do?

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
On 04/15/2016 02:24 PM, jmh530 wrote: I had not realized that the main reason that inout was added was because of not being able to use templates as virtual functions in classes. The main reason is actually avoiding code duplication is such situations (i.e. the problem has a solution just not

Dead link finding automation

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
Can we automate stuff like https://issues.dlang.org/show_bug.cgi?id=15929? There are quite a few tools around, not to mention we could easily roll our own. Who'd like to take this project? Thx! -- Andrei

[Issue 15928] chain(r1, r2, r3, ...) should discard all arguments after the first infinite range

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15928 --- Comment #2 from Andrei Alexandrescu --- @Marc didn't think of that. But then what do you do when you come back and you finish the bidir ranges after the infinite one. So then you have a non-empty range that you can't pop back

Re: Is this a bug?

2016-04-15 Thread Eric via Digitalmars-d-learn
On Friday, 15 April 2016 at 17:43:59 UTC, ag0aep6g wrote: On 15.04.2016 19:13, Eric wrote: 1 alias J = const C; 2 3 void main(string[] args) 4 { 5 J a = new C(); 6 I!(J) i = a; 7 } 8 9 interface I(V) { } 10 11 class F(V) if (is(V : I!(V))) { } 12 13

Re: So what does (inout int = 0) do?

2016-04-15 Thread jmh530 via Digitalmars-d
On Friday, 15 April 2016 at 17:11:39 UTC, Andrei Alexandrescu wrote: 3. For all problems that inout is purported to solve, I know of idioms that are definitely simpler and overall almost as good if not better. So a hard question is whether the existence is justified. If it's something to

move has{Mobile,Swappable}Elements and move{Front,Back,At} to std.algorithm.mutation

2016-04-15 Thread Seb via Digitalmars-d
Hi all, since this has been pending for more than one week without a lot of interest and it's a larger deprecation, I thought I try to ping people here. #4170 [1] is a proposal to move moveAt, moveFront and moveBack to std.algorithm.mutation. It also moves the two templates

[Issue 15929] New: First sentence to https://dlang.org/library/std/range/primitives.html points to invalid link https://dlang.org/library/std/range/std_range.html

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15929 Issue ID: 15929 Summary: First sentence to https://dlang.org/library/std/range/primitives.html points to invalid link https://dlang.org/library/std/range/std_range.html

[Issue 15928] chain(r1, r2, r3, ...) should discard all arguments after the first infinite range

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15928 Marc Schütz changed: What|Removed |Added CC||schue...@gmx.net ---

Re: De Facto standard for D programming language

2016-04-15 Thread jmh530 via Digitalmars-d-learn
On Friday, 15 April 2016 at 17:51:41 UTC, Napster wrote: I would like to start learning the De Facto standard. which book or document would you use? http://erdani.com/index.php/books/tdpl/ or https://dlang.org/spec/intro.html which one would you call de facto standard? If I were learning

chain should stop chaining at the first infinite range

2016-04-15 Thread Andrei Alexandrescu via Digitalmars-d
https://issues.dlang.org/show_bug.cgi?id=15928 Destroy! -- Andrei

[Issue 15928] chain(r1, r2, r3, ...) should discard all arguments after the first infinite range

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15928 Andrei Alexandrescu changed: What|Removed |Added Hardware|x86_64 |All

[Issue 15928] New: chain(r1, r2, r3, ...) should discard all arguments after the first infinite range

2016-04-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15928 Issue ID: 15928 Summary: chain(r1, r2, r3, ...) should discard all arguments after the first infinite range Product: D Version: D2 Hardware: x86_64 OS: Linux

Re: Any usable SIMD implementation?

2016-04-15 Thread Johan Engelen via Digitalmars-d
On Sunday, 3 April 2016 at 07:39:00 UTC, Manu wrote: On 3 April 2016 at 16:14, 9il via Digitalmars-d wrote: Is it possible to introduce compile time information about target platform? I am working on BLAS from scratch implementation. And it is no hope to create

Re: Official dub packages for Debian and Ubuntu

2016-04-15 Thread Jordi Sayol via Digitalmars-d-announce
El 15/04/16 a les 19:52, Andrei Alexandrescu via Digitalmars-d-announce ha escrit: > Awesomne, Jordi. I recently got a notice that the dmd compiler has been > updated by Ubuntu's package manager. Clicked, got it, all went smoothly. > Should I take it we owe all of that to you? -- Andrei I

  1   2   >