Re: Catching std.conv.ConvException in readf causes a buffer overrun

2018-06-26 Thread Shigeki Karita via Digitalmars-d-learn
On Wednesday, 27 June 2018 at 02:39:49 UTC, Shigeki Karita wrote: import std.stdio; import std.conv; void main() { int i; try { readf("%d\n", ); // "a" } catch (ConvException e) { auto s = readln(); writeln(s); // "aa", "aaa" or SEGV ??? } }

[Issue 18724] ICE in dmd/dsymbol.d(890)

2018-06-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18724 Seb changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Issue 18721] ICE in dmd/cond.d(378) when compiling static foreach with -D

2018-06-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18721 Seb changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

Re: 'static foreach' chapter and more

2018-06-26 Thread walker via Digitalmars-d-announce
On Tuesday, 26 June 2018 at 01:52:42 UTC, Ali Çehreli wrote: I've made some online improvements to "Programming in D" since September 2017. [...] Thank you! One great book which I have read!

Catching std.conv.ConvException in readf causes a buffer overrun

2018-06-26 Thread Shigeki Karita via Digitalmars-d-learn
import std.stdio; import std.conv; void main() { int i; try { readf("%d\n", ); // "a" } catch (ConvException e) { auto s = readln(); writeln(s); // "aa", "aaa" or SEGV ??? } } https://wandbox.org/permlink/NMYNjpOgQtfUprBQ I just want to retry reading if

[Issue 17423] pointer assignment to `this` in member function is not accounted for

2018-06-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17423 --- Comment #10 from Walter Bright --- This example actually works now, see https://github.com/dlang/dmd/pull/8408 --

Re: CustomString and string constraints

2018-06-26 Thread SrMordred via Digitalmars-d-learn
On Tuesday, 26 June 2018 at 22:16:28 UTC, Jonathan M Davis wrote: If what you're asking is whether it's possible for a template constraint that uses something like isSomeString will ever match a user-defined type, then the answer is no. Thats exactly what I wanted xD. My idea was that if

Re: `update` and `require` properties for AA

2018-06-26 Thread Seb via Digitalmars-d
On Tuesday, 26 June 2018 at 16:17:03 UTC, Timoses wrote: Doesn't it already offer it? Here https://dlang.org/spec/hash-map.html in the very top right corner you can diverge from master. However it seems a bit bugged that when selecting something else than master, it suddenly prints master

Re: `update` and `require` properties for AA

2018-06-26 Thread Seb via Digitalmars-d
On Tuesday, 26 June 2018 at 16:54:11 UTC, Steven Schveighoffer wrote: On 6/26/18 12:48 PM, Steven Schveighoffer wrote: On 6/26/18 11:51 AM, H. S. Teoh wrote: On Tue, Jun 26, 2018 at 07:25:09AM +, Mike Franklin via Digitalmars-d wrote: [...] I think the documentation gets published

Re: `update` and `require` properties for AA

2018-06-26 Thread Seb via Digitalmars-d
On Tuesday, 26 June 2018 at 17:12:37 UTC, H. S. Teoh wrote: On Tue, Jun 26, 2018 at 12:54:11PM -0400, Steven Schveighoffer via Digitalmars-d wrote: [...] 1. The dlang.org repository is backwards -- master generates the docs for the default dlang.org. I've brought this up before, still don't

Re: CustomString and string constraints

2018-06-26 Thread Jonathan M Davis via Digitalmars-d-learn
n Tuesday, June 26, 2018 17:14:08 SrMordred via Digitalmars-d-learn wrote: > Is possible to make a Custom Struct String work for D string > constraints? > > eg: > > struct MyString > { > char[] arr; > alias arr this; > } > > void getString( char[] str ){} > > MyString().split(";");

Re: Nullable!T with T of class type

2018-06-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, June 26, 2018 19:03:20 kdevel via Digitalmars-d-learn wrote: > On Monday, 25 June 2018 at 22:58:41 UTC, Jonathan M Davis wrote: > > On Monday, June 25, 2018 19:40:30 kdevel via > > > > Digitalmars-d-learn wrote: > >> R r; > >> > >> if (r.s is null) > >> > >>throw new

Re: template recursion

2018-06-26 Thread Nathan S. via Digitalmars-d-learn
On Tuesday, 26 June 2018 at 20:47:27 UTC, Steven Schveighoffer wrote: Naming the hook for `put` the same thing as the global function was one of the biggest mistakes in the range library. I almost think we would be better off to deprecate that and pick another hook name. If you ever do that

Re: template recursion

2018-06-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/26/18 6:01 AM, ag0aep6g wrote: On line 23, you're apparently trying to call std.range.put (which would in turn call tarr[t].put). But being in a method that is itself called "put", that line is instead interpreted as a recursive call (which fails). To refer to std.range.put, you have to

Re: Nullable!T with T of class type

2018-06-26 Thread kdevel via Digitalmars-d-learn
On Tuesday, 26 June 2018 at 14:32:59 UTC, Nathan S. wrote: On Monday, 25 June 2018 at 19:40:30 UTC, kdevel wrote: Is it possible to "lower" the Nullable operations if T is a class type such that there is only one level of nullification? Yes: https://run.dlang.io/is/hPxbyf template

[Issue 19027] iota(int.min, int.max).length is incorrect

2018-06-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19027 Steven Schveighoffer changed: What|Removed |Added CC||schvei...@yahoo.com

Re: Phobos begat madness

2018-06-26 Thread David Bennett via Digitalmars-d
On Monday, 25 June 2018 at 01:03:03 UTC, David Bennett wrote: On Friday, 22 June 2018 at 21:37:07 UTC, Walter Bright wrote: If someone wants to figure out how to build an uncomplicated, straightforward, efficient implementation of text() that we can be proud of, that would be a nice

Re: Disappointing performance from DMD/Phobos

2018-06-26 Thread Basile B. via Digitalmars-d
On Tuesday, 26 June 2018 at 02:20:37 UTC, Manu wrote: On Mon, 25 Jun 2018 at 19:10, Manu wrote: Some code: - struct Entity { enum NumSystems = 4; struct SystemData { uint start, length; } SystemData[NumSystems] systemData; @property uint

Re: Disappointing performance from DMD/Phobos

2018-06-26 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, June 26, 2018 10:38:42 Manu via Digitalmars-d wrote: > On Mon, 25 Jun 2018 at 20:17, Jonathan M Davis via Digitalmars-d > > wrote: > > dmd's inliner is notoriously poor, > > I know, but it's still the reference compiler, and it should at least > to a reasonable job at the kind of D

Re: Disappointing performance from DMD/Phobos

2018-06-26 Thread kinke via Digitalmars-d
On Tuesday, 26 June 2018 at 17:38:42 UTC, Manu wrote: I know, but it's still the reference compiler, and it should at least to a reasonable job at the kind of D code that it's *recommended* that users write. I get your point, but IMO it's all about efficient allocation of the manpower we

Re: Nullable!T with T of class type

2018-06-26 Thread kdevel via Digitalmars-d-learn
On Monday, 25 June 2018 at 22:58:41 UTC, Jonathan M Davis wrote: On Monday, June 25, 2018 19:40:30 kdevel via Digitalmars-d-learn wrote: R r; if (r.s is null) throw new Exception ("some error message"); [...] Why can't this programming error be detected at compile time? If

Re: Disappointing performance from DMD/Phobos

2018-06-26 Thread Iain Buclaw via Digitalmars-d
On 26 June 2018 at 20:07, Manu via Digitalmars-d wrote: > On Tue, 26 Jun 2018 at 10:43, Iain Buclaw via Digitalmars-d > wrote: >> >> On 26 June 2018 at 19:41, Manu via Digitalmars-d >> wrote: >> > On Mon, 25 Jun 2018 at 20:50, Nicholas Wilson via Digitalmars-d >> > wrote: >> >> >> >> Then use

Re: Disappointing performance from DMD/Phobos

2018-06-26 Thread Iain Buclaw via Digitalmars-d
On 26 June 2018 at 20:26, Eugene Wissner via Digitalmars-d wrote: > On Tuesday, 26 June 2018 at 18:07:56 UTC, Manu wrote: >> >> On Tue, 26 Jun 2018 at 10:43, Iain Buclaw via Digitalmars-d >> wrote: >>> >>> >>> On 26 June 2018 at 19:41, Manu via Digitalmars-d >>> wrote: >>> > On Mon, 25 Jun 2018

Re: Disappointing performance from DMD/Phobos

2018-06-26 Thread Eugene Wissner via Digitalmars-d
On Tuesday, 26 June 2018 at 18:07:56 UTC, Manu wrote: On Tue, 26 Jun 2018 at 10:43, Iain Buclaw via Digitalmars-d wrote: On 26 June 2018 at 19:41, Manu via Digitalmars-d wrote: > On Mon, 25 Jun 2018 at 20:50, Nicholas Wilson via > Digitalmars-d wrote: >> >> Then use LDC! ;) > > Keep LDC

Re: First run after build on Windows is slow

2018-06-26 Thread Patrick Schluter via Digitalmars-d-learn
On Tuesday, 26 June 2018 at 12:58:29 UTC, Adam D. Ruppe wrote: On Tuesday, 26 June 2018 at 12:40:05 UTC, phs wrote: Although, it's a little bit strange because I have never had this issue with my C++ development. The c++ compiler and runtime libraries are common enough that the antivirus

Re: Disappointing performance from DMD/Phobos

2018-06-26 Thread Manu via Digitalmars-d
On Tue, 26 Jun 2018 at 10:43, Iain Buclaw via Digitalmars-d wrote: > > On 26 June 2018 at 19:41, Manu via Digitalmars-d > wrote: > > On Mon, 25 Jun 2018 at 20:50, Nicholas Wilson via Digitalmars-d > > wrote: > >> > >> Then use LDC! ;) > > > > Keep LDC up to date with DMD master daily! ;) > >

Re: How do I call this tamplte function?

2018-06-26 Thread Ali Çehreli via Digitalmars-d-learn
On 06/26/2018 10:37 AM, Rib wrote: to get get() from std.net.curl return a ubyte[] and use my http instance, all those failed: string link = "http://...;; auto client = HTTP(); // set some client attributes... auto fileContents = get!(AutoProtocol, ubyte)(link, client); auto fileContents =

Re: 'static foreach' chapter and more

2018-06-26 Thread Ali Çehreli via Digitalmars-d-announce
On 06/26/2018 06:24 AM, ShadoLight wrote: > RevisionHistory on your ddili.org site? Ok, I should be able to do that by browsing the book's repo history even for past revisions: https://bitbucket.org/acehreli/ddili/commits/all > as a kind of "Quick-Reference" book to D now I'm not sure

Re: Disappointing performance from DMD/Phobos

2018-06-26 Thread Iain Buclaw via Digitalmars-d
On 26 June 2018 at 19:41, Manu via Digitalmars-d wrote: > On Mon, 25 Jun 2018 at 20:50, Nicholas Wilson via Digitalmars-d > wrote: >> >> Then use LDC! ;) > > Keep LDC up to date with DMD master daily! ;) Like what GDC is doing (almost) ;-) Iain.

Re: Disappointing performance from DMD/Phobos

2018-06-26 Thread Manu via Digitalmars-d
On Mon, 25 Jun 2018 at 20:50, Nicholas Wilson via Digitalmars-d wrote: > > Then use LDC! ;) Keep LDC up to date with DMD master daily! ;)

How do I call this tamplte function?

2018-06-26 Thread Rib via Digitalmars-d-learn
to get get() from std.net.curl return a ubyte[] and use my http instance, all those failed: string link = "http://...;; auto client = HTTP(); // set some client attributes... auto fileContents = get!(AutoProtocol, ubyte)(link, client); auto fileContents = get!(ubyte)(link, client); auto

Re: Disappointing performance from DMD/Phobos

2018-06-26 Thread Manu via Digitalmars-d
On Mon, 25 Jun 2018 at 20:17, Jonathan M Davis via Digitalmars-d wrote: > > dmd's inliner is notoriously poor, I know, but it's still the reference compiler, and it should at least to a reasonable job at the kind of D code that it's *recommended* that users write. That line of code is the sort

CustomString and string constraints

2018-06-26 Thread SrMordred via Digitalmars-d-learn
Is possible to make a Custom Struct String work for D string constraints? eg: struct MyString { char[] arr; alias arr this; } void getString( char[] str ){} MyString().split(";"); //oops, type mismatch getString( MyString() ); //fine, implicit conversion

Re: `update` and `require` properties for AA

2018-06-26 Thread H. S. Teoh via Digitalmars-d
On Tue, Jun 26, 2018 at 12:54:11PM -0400, Steven Schveighoffer via Digitalmars-d wrote: [...] > 1. The dlang.org repository is backwards -- master generates the docs > for the default dlang.org. I've brought this up before, still don't > understand why we don't use stable for the latest

Re: `update` and `require` properties for AA

2018-06-26 Thread Steven Schveighoffer via Digitalmars-d
On 6/26/18 12:48 PM, Steven Schveighoffer wrote: On 6/26/18 11:51 AM, H. S. Teoh wrote: On Tue, Jun 26, 2018 at 07:25:09AM +, Mike Franklin via Digitalmars-d wrote: [...] I think the documentation gets published prematurely.  The new methods for the associative arrays should come in the

Re: `update` and `require` properties for AA

2018-06-26 Thread Steven Schveighoffer via Digitalmars-d
On 6/26/18 11:51 AM, H. S. Teoh wrote: On Tue, Jun 26, 2018 at 07:25:09AM +, Mike Franklin via Digitalmars-d wrote: [...] I think the documentation gets published prematurely. The new methods for the associative arrays should come in the next release, scheduled for July 1st.

Re: `update` and `require` properties for AA

2018-06-26 Thread H. S. Teoh via Digitalmars-d
On Tue, Jun 26, 2018 at 04:17:03PM +, Timoses via Digitalmars-d wrote: > On Tuesday, 26 June 2018 at 15:51:00 UTC, H. S. Teoh wrote: [...] > > Seriously, we need to start implementing versioned docs on dlang.org. [...] > Doesn't it already offer it? > > Here

Re: Beta 2.081.0

2018-06-26 Thread Martin Nowak via Digitalmars-d-announce
On 06/17/2018 06:42 AM, Martin Nowak wrote: > Glad to announce the first beta for the 2.081.0 release, ♥ to the 52 > contributors for this release. Second Beta live now.

Re: `update` and `require` properties for AA

2018-06-26 Thread Timoses via Digitalmars-d
On Tuesday, 26 June 2018 at 15:51:00 UTC, H. S. Teoh wrote: On Tue, Jun 26, 2018 at 07:25:09AM +, Mike Franklin via Digitalmars-d wrote: [...] I think the documentation gets published prematurely. The new methods for the associative arrays should come in the next release, scheduled for

Re: opDispatch and alias this

2018-06-26 Thread Steven Schveighoffer via Digitalmars-d
On 6/25/18 7:13 PM, Seb wrote: Apparently three years ago it was we decided to ban alias this and opDispatch in the same class. What are your thoughts on this now? Is anyone depending on using alias this + opDispatch together like e.g. in https://github.com/dlang/phobos/pull/6596? My

[Issue 18068] No file names and line numbers in stack trace

2018-06-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18068 Thibaut CHARLES changed: What|Removed |Added CC||cro...@gmail.com --

Re: `update` and `require` properties for AA

2018-06-26 Thread H. S. Teoh via Digitalmars-d
On Tue, Jun 26, 2018 at 07:25:09AM +, Mike Franklin via Digitalmars-d wrote: [...] > I think the documentation gets published prematurely. The new methods > for the associative arrays should come in the next release, scheduled > for July 1st.

Re: Disappointing performance from DMD/Phobos

2018-06-26 Thread H. S. Teoh via Digitalmars-d
When I see "DMD" and "performance" in the same sentence, my first reaction is, "why aren't you using LDC or GDC"? Seriously, doing performance measurements with DMD is a waste of time, because its optimizer has been proven time and again to be suboptimal (har!). DMD frequently produces

Re: D hash table comparison benchmark

2018-06-26 Thread Nathan S. via Digitalmars-d
On Tuesday, 26 June 2018 at 14:33:25 UTC, Eugene Wissner wrote: Tanya hashes any value, also integral types; other hashtables probably not. Your intuition is correct here. Most of the tables use `typeid(key).getHash()`, which for `int` just returns `key`. = Built-in AA = General case:

Re: Nullable!T with T of class type

2018-06-26 Thread Nathan S. via Digitalmars-d-learn
On Monday, 25 June 2018 at 22:58:41 UTC, Jonathan M Davis wrote: Java does try to force you to initialize stuff (resulting in annoying false positives at times), but in general, it still can't guarantee when a variable is null or not and is forced to insert runtime null checks. Java can be

[Issue 19028] Emit warning for identifiers starting with `__`

2018-06-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19028 Steven Schveighoffer changed: What|Removed |Added CC||schvei...@yahoo.com --- Comment #1

Re: D hash table comparison benchmark

2018-06-26 Thread Eugene Wissner via Digitalmars-d
On Tuesday, 26 June 2018 at 09:03:10 UTC, Eugene Wissner wrote: It seems it doesn't work with a branch in dub.sdl. I just replaced the files in ~/.dub/packages. And to make tanya perform better than built-in AAs in the first test, define a hash function: size_t hasher(int e) { return e;

Re: Nullable!T with T of class type

2018-06-26 Thread Nathan S. via Digitalmars-d-learn
On Monday, 25 June 2018 at 19:40:30 UTC, kdevel wrote: Is it possible to "lower" the Nullable operations if T is a class type such that there is only one level of nullification? Yes: https://run.dlang.io/is/hPxbyf template Nullable(S) { import std.traits : isPointer,

[Issue 19026] Aliasing an inner function gets context but aliasing a member function through instance does not

2018-06-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19026 Steven Schveighoffer changed: What|Removed |Added CC||schvei...@yahoo.com --

Re: Visual D 0.47.0 released

2018-06-26 Thread Robert M. Münch via Digitalmars-d-learn
On 2018-06-24 13:08:53 +, Rainer Schuetze said: a new release of Visual D has just been uploaded. Major changes are * improved Visual C++ project integration: better dependencies, automatic libraries, name demangling * new project wizard * mago debugger: show vtable, dynamic type of

[Issue 19029] New: Provide alias symbol name trait

2018-06-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19029 Issue ID: 19029 Summary: Provide alias symbol name trait Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1

Re: D hash table comparison benchmark

2018-06-26 Thread Nathan S. via Digitalmars-d
BTW the output is formatted so you can get a sorted list of times across all trials by piping the output through `sort -n`. That's also why the tests reusing maps start with ( instead of [, so they will be grouped separately.

Re: alias symbol name

2018-06-26 Thread Radu via Digitalmars-d-learn
On Tuesday, 26 June 2018 at 12:19:16 UTC, Jonathan M Davis wrote: On Tuesday, June 26, 2018 11:28:11 Radu via Digitalmars-d-learn wrote: > [...] Ha! :) yeah I was pretty sure this will not work. I'm looking to generate some custom wrappers and knowing when something is really `size_t` is

Re: 'static foreach' chapter and more

2018-06-26 Thread ShadoLight via Digitalmars-d-announce
On Tuesday, 26 June 2018 at 01:52:42 UTC, Ali Çehreli wrote: I've made some online improvements to "Programming in D" since September 2017. http://ddili.org/ders/d.en/index.html Ali Hi Ali, Thanks for your book - it is the definitive go-to resource for D newcomers as well as

Re: 'static foreach' chapter and more

2018-06-26 Thread jmh530 via Digitalmars-d-announce
On Tuesday, 26 June 2018 at 01:52:42 UTC, Ali Çehreli wrote: I've made some online improvements to "Programming in D" since September 2017. [snip] +1

Re: First run after build on Windows is slow

2018-06-26 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 26 June 2018 at 12:40:05 UTC, phs wrote: Although, it's a little bit strange because I have never had this issue with my C++ development. The c++ compiler and runtime libraries are common enough that the antivirus realizes it is nothing special, but since D is more obscure it

Re: First run after build on Windows is slow

2018-06-26 Thread phs via Digitalmars-d-learn
On Tuesday, 26 June 2018 at 12:26:45 UTC, rikki cattermole wrote: On 27/06/2018 12:25 AM, phs wrote: Hello. I've made a simple hello world program using dub and dmd for Windows. Everything works well, except that every first run after each rebuild takes around 3 seconds just to start up. Is

First run after build on Windows is slow

2018-06-26 Thread phs via Digitalmars-d-learn
Hello. I've made a simple hello world program using dub and dmd for Windows. Everything works well, except that every first run after each rebuild takes around 3 seconds just to start up. Is it normal at all?

Re: First run after build on Windows is slow

2018-06-26 Thread rikki cattermole via Digitalmars-d-learn
On 27/06/2018 12:25 AM, phs wrote: Hello. I've made a simple hello world program using dub and dmd for Windows. Everything works well, except that every first run after each rebuild takes around 3 seconds just to start up. Is it normal at all? Its normal if you don't add an exclusion for that

Re: alias symbol name

2018-06-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, June 26, 2018 11:28:11 Radu via Digitalmars-d-learn wrote: > > I'm pretty sure that that's impossible. As I understand it, the > > compiler basically just replaces aliases with what they refer > > to and doesn't care what the original type was. And they > > _definitely_ don't affect

[Issue 12507] SysTime.init.toString should not segfault

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

[Issue 12507] SysTime.init.toString should not segfault

2018-06-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12507 --- Comment #12 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/9b1f72d89b6db38a05b958baf2195f552fe0aa57 Fix issue 12507: SysTime.init.toString() segfaults.

Re: alias symbol name

2018-06-26 Thread Radu via Digitalmars-d-learn
On Tuesday, 26 June 2018 at 10:19:44 UTC, Jonathan M Davis wrote: On Tuesday, June 26, 2018 09:47:44 Radu via Digitalmars-d-learn wrote: On Tuesday, 26 June 2018 at 09:24:15 UTC, Stefan Koch wrote: > On Tuesday, 26 June 2018 at 09:14:11 UTC, Radu wrote: >> Consider this

Re: alias symbol name

2018-06-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, June 26, 2018 09:47:44 Radu via Digitalmars-d-learn wrote: > On Tuesday, 26 June 2018 at 09:24:15 UTC, Stefan Koch wrote: > > On Tuesday, 26 June 2018 at 09:14:11 UTC, Radu wrote: > >> Consider this https://run.dlang.io/is/HyY2qG > >> > >> --- > >> void main() > >> { > >> > >>

Re: template recursion

2018-06-26 Thread Alex via Digitalmars-d-learn
On Tuesday, 26 June 2018 at 10:01:06 UTC, ag0aep6g wrote: On line 23, you're apparently trying to call std.range.put (which would in turn call tarr[t].put). But being in a method that is itself called "put", that line is instead interpreted as a recursive call (which fails). To refer to

Re: template recursion

2018-06-26 Thread ag0aep6g via Digitalmars-d-learn
On 06/26/2018 11:35 AM, Alex wrote: ´´´ import std.range; void main() { T.member.tarr.length = 42; //put(T.member, 4); // line 6 T.member.put(4); // line 7 } struct T { void put(Type)(Type t){} // line 13 static B member; } struct B { T[] tarr; void

Re: Tuple DIP

2018-06-26 Thread Francesco Mecca via Digitalmars-d
On Friday, 12 January 2018 at 22:44:48 UTC, Timon Gehr wrote: As promised [1], I have started setting up a DIP to improve tuple ergonomics in D: [...] What is the status of the DIP? Is it ready to be proposed and dicussed?

Re: alias symbol name

2018-06-26 Thread Radu via Digitalmars-d-learn
On Tuesday, 26 June 2018 at 09:24:15 UTC, Stefan Koch wrote: On Tuesday, 26 June 2018 at 09:14:11 UTC, Radu wrote: Consider this https://run.dlang.io/is/HyY2qG --- void main() { import std.traits; size_t s; pragma(msg, typeof(s).stringof); pragma(msg, mangledName!(typeof(s)));

template recursion

2018-06-26 Thread Alex via Digitalmars-d-learn
Hi all, I have a strange case of template recursion, which I don't know how to solve: ´´´ import std.range; void main() { T.member.tarr.length = 42; //put(T.member, 4); // line 6 T.member.put(4); // line 7 } struct T { void put(Type)(Type t){} // line 13

Re: alias symbol name

2018-06-26 Thread Stefan Koch via Digitalmars-d-learn
On Tuesday, 26 June 2018 at 09:14:11 UTC, Radu wrote: Consider this https://run.dlang.io/is/HyY2qG --- void main() { import std.traits; size_t s; pragma(msg, typeof(s).stringof); pragma(msg, mangledName!(typeof(s))); pragma(msg, mangledName!s); } --- It outputs: --- ulong

Re: 'static foreach' chapter and more

2018-06-26 Thread Ali Çehreli via Digitalmars-d-announce
On 06/26/2018 02:18 AM, Ali Çehreli wrote: this time I *think* the index section will be correct. :) I meant Table of Contents will exist. :) Ali

Re: 'static foreach' chapter and more

2018-06-26 Thread Ali Çehreli via Digitalmars-d-announce
On 06/26/2018 12:52 AM, Martin Tschierschke wrote: On Tuesday, 26 June 2018 at 01:52:42 UTC, Ali Çehreli wrote: I've made some online improvements to "Programming in D" since September 2017. [...] Very good, thank you, please trow it to your converter to make a ..pub for me of it :-) I

Re: Visual D 0.47.0 released

2018-06-26 Thread Radu via Digitalmars-d-announce
On Sunday, 24 June 2018 at 13:08:53 UTC, Rainer Schuetze wrote: Hi, a new release of Visual D has just been uploaded. Major changes are * improved Visual C++ project integration: better dependencies, automatic libraries, name demangling * new project wizard * mago debugger: show vtable,

alias symbol name

2018-06-26 Thread Radu via Digitalmars-d-learn
Consider this https://run.dlang.io/is/HyY2qG --- void main() { import std.traits; size_t s; pragma(msg, typeof(s).stringof); pragma(msg, mangledName!(typeof(s))); pragma(msg, mangledName!s); } --- It outputs: --- ulong m _D9onlineapp4mainFZ1sm --- I'm looking for a way to

Re: D hash table comparison benchmark

2018-06-26 Thread Eugene Wissner via Digitalmars-d
It seems it doesn't work with a branch in dub.sdl. I just replaced the files in ~/.dub/packages.

Re: allMembers broke for __

2018-06-26 Thread dayllenger via Digitalmars-d
On Tuesday, 19 June 2018 at 12:59:00 UTC, Steven Schveighoffer wrote: I'd recommend putting in an enhancement request in bugzilla. Done: https://issues.dlang.org/show_bug.cgi?id=19028 Really, this behaviour at least should be reflected in `allMembers` and `derivedMembers` documentation.

Re: D hash table comparison benchmark

2018-06-26 Thread Eugene Wissner via Digitalmars-d
On Tuesday, 26 June 2018 at 04:17:44 UTC, Nathan S. wrote: On Tuesday, 26 June 2018 at 03:45:27 UTC, Seb wrote: Did you by chance also benchmark it with other languages like C++, Go or Rust? I didn't since I was evaluating hashtable implementations for use in a D application. BTW I'm not

[Issue 19028] New: Emit warning for identifiers starting with `__`

2018-06-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19028 Issue ID: 19028 Summary: Emit warning for identifiers starting with `__` Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement

Re: 'static foreach' chapter and more

2018-06-26 Thread Martin Tschierschke via Digitalmars-d-announce
On Tuesday, 26 June 2018 at 01:52:42 UTC, Ali Çehreli wrote: I've made some online improvements to "Programming in D" since September 2017. [...] Very good, thank you, please trow it to your converter to make a .pub for me of it :-)

Re: Making sense of recursion

2018-06-26 Thread Timoses via Digitalmars-d-learn
On Monday, 25 June 2018 at 17:45:01 UTC, zbr wrote: Hi, this question is not specifically D related but I'll just ask anyway. Consider the following snippet: void mergeSort(int[] arr, int l, int r) { if (l < r) // 1 { int m = l+(r-l)/2;// 2

Re: `update` and `require` properties for AA

2018-06-26 Thread Vasniktel via Digitalmars-d
On Tuesday, 26 June 2018 at 07:25:09 UTC, Mike Franklin wrote: I think the documentation gets published prematurely. The new methods for the associative arrays should come in the next release, scheduled for July 1st. https://dlang.org/changelog/pending.html#require_update Mike Wow,

Re: `update` and `require` properties for AA

2018-06-26 Thread Mike Franklin via Digitalmars-d
On Tuesday, 26 June 2018 at 07:05:44 UTC, Vasniktel wrote: Hello everyone. I am wondering about `update` and `require` properties of AAs which are mentioned to be present here: https://dlang.org/spec/hash-map.html#properties However, this code doesn't compile: ``` import std.stdio; void

Re: 'static foreach' chapter and more

2018-06-26 Thread M.M. via Digitalmars-d-announce
On Tuesday, 26 June 2018 at 01:52:42 UTC, Ali Çehreli wrote: I've made some online improvements to "Programming in D" since September 2017. [...] This is really great that you keep this important source of information on D and on programming-in-general up-to-date. Good luck with the

`update` and `require` properties for AA

2018-06-26 Thread Vasniktel via Digitalmars-d
Hello everyone. I am wondering about `update` and `require` properties of AAs which are mentioned to be present here: https://dlang.org/spec/hash-map.html#properties However, this code doesn't compile: ``` import std.stdio; void main() { class C{} int[C] aa; auto a =

[Issue 19026] Aliasing an inner function gets context but aliasing a member function through instance does not

2018-06-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19026 Alex changed: What|Removed |Added CC||sascha.or...@gmail.com --

[Issue 19027] iota(int.min, int.max).length is incorrect

2018-06-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19027 greenify changed: What|Removed |Added Keywords||pull CC|

Re: foreach / mutating iterator - How to do this?

2018-06-26 Thread Robert M. Münch via Digitalmars-d-learn
On 2018-06-25 15:29:23 +, Robert M. Münch said: I have two foreach loops where the inner should change the iterator (append new entries) of the outer. foreach(a, candidates) { foreach(b, a) { if(...) candidates ~= additionalCandidate; } } The foreach docs