Re: Efficient enum array keys?

2019-04-10 Thread Basile B. via Digitalmars-d-learn
On Thursday, 11 April 2019 at 06:20:05 UTC, Julian wrote: Hello, When reading through the following D blog post, I noticed in the feature chart that D had "Arrays beginning at arbitrary indices" as a +1 feature, the same as in Ada. https://dlang.org/blog/2018/06/20/how-an-engineering-company-

Efficient enum array keys?

2019-04-10 Thread Julian via Digitalmars-d-learn
Hello, When reading through the following D blog post, I noticed in the feature chart that D had "Arrays beginning at arbitrary indices" as a +1 feature, the same as in Ada. https://dlang.org/blog/2018/06/20/how-an-engineering-company-chose-to-migrate-to-d/ That surprised me, and from the cod

Re: Overloads not returning appropriate info. [Field reflunkory]

2019-04-10 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Apr 10, 2019 at 11:05:27PM +, Adam D. Ruppe via Digitalmars-d-learn wrote: > On Wednesday, 10 April 2019 at 19:29:13 UTC, Alex wrote: > > I wonder if there are some interesting patterns of nesting is's? > > > > is(...is(...is(...)...)...) > > No, at least not like that. You'd get not

Re: Overloads not returning appropriate info. [Field reflunkory]

2019-04-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 10 April 2019 at 19:29:13 UTC, Alex wrote: I wonder if there are some interesting patterns of nesting is's? is(...is(...is(...)...)...) No, at least not like that. You'd get nothing out of it, even if you made it work. But, I have in the past nested static ifs with different i

Re: Dummy template parameter vs empty template parameter list

2019-04-10 Thread Seb via Digitalmars-d-learn
On Wednesday, 10 April 2019 at 20:37:38 UTC, Ben Jones wrote: Looking through Phobos code there's a bunch functions defined with dummy template types: void whatever(TDummy = void)( int x, ...) //TDummy is never used Why not just use an empty template parameter list? void whatever()(int x, ...

Re: Templates - What's Up with the template keyword?

2019-04-10 Thread Ali Çehreli via Digitalmars-d-learn
On 04/10/2019 05:07 AM, Ron Tarrant wrote: >> the book's index: >> >> http://ddili.org/ders/d.en/ix.html > Oops! Not at all. One of the most useful parts of the book has been the index section for me. I occasionally search in there... like just yesterday for the positional format specifier

Dummy template parameter vs empty template parameter list

2019-04-10 Thread Ben Jones via Digitalmars-d-learn
Looking through Phobos code there's a bunch functions defined with dummy template types: void whatever(TDummy = void)( int x, ...) //TDummy is never used Why not just use an empty template parameter list? void whatever()(int x, ...) My gut tells me that his is a workaround for an old limitat

Re: Overloads not returning appropriate info. [Field reflunkory]

2019-04-10 Thread Alex via Digitalmars-d-learn
On Tuesday, 9 April 2019 at 21:00:55 UTC, H. S. Teoh wrote: On Tue, Apr 09, 2019 at 08:49:17PM +, Alex via Digitalmars-d-learn wrote: On Tuesday, 9 April 2019 at 18:56:58 UTC, H. S. Teoh wrote: [...] My point has been and is that there is a better way that is more natural. I make no claim

Re: Overloads not returning appropriate info. [Field reflunkory]

2019-04-10 Thread Alex via Digitalmars-d-learn
On Wednesday, 10 April 2019 at 02:19:42 UTC, Adam D. Ruppe wrote: On Tuesday, 9 April 2019 at 20:45:18 UTC, Alex wrote: On Tuesday, 9 April 2019 at 18:33:21 UTC, Seb wrote: Have you considered writing a DIP? No, because I expect it won't even be considered. You won't pass review if you don'

Re: Overloads not returning appropriate info. [Field reflunkory]

2019-04-10 Thread Alex via Digitalmars-d-learn
On Wednesday, 10 April 2019 at 14:06:53 UTC, Adam D. Ruppe wrote: On Wednesday, 10 April 2019 at 10:18:35 UTC, H. S. Teoh wrote: [...] There's a little bit weird about it, but it makes sense. I used to find it hard to even remember how it works, but then I had to describe it for the book and

Cyclic dependency between module A and B

2019-04-10 Thread kdevel via Digitalmars-d-learn
Recently (before refactoring) my application complained right after invocation: object.Error@src/rt/minfo.d(371): Cyclic dependency between module Filebrowser and App Filebrowser* -> App* -> Filebrowser* Is it possible to detect this dependency before the program is started? Per

DCD 0 symbols cached?

2019-04-10 Thread Tom via Digitalmars-d-learn
Total newbie to D, trying to get it to play nice with Neovim using ncm2-d and DCD. Issue: DCD never caches any symbols even when I point it directly to DMD's include files. Hate to ask for tech support on this forum but it's all I've got, Googling has brought no luck. Using dcd version v0

Re: DRuntime arguments

2019-04-10 Thread Seb via Digitalmars-d-learn
On Wednesday, 10 April 2019 at 12:11:06 UTC, Cym13 wrote: Where can I find a list of all druntime arguments supported? Things like --DRT-covopt='merge:1' or --DRT-gcopt='gc:profile=1' are not easy to guess and I can't find any centralized documentation. There isn't any yet.

Re: Overloads not returning appropriate info. [Field reflunkory]

2019-04-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 10 April 2019 at 10:18:35 UTC, H. S. Teoh wrote: The functionality rocks, but the syntax is a horrendous hairball of inconsistencies and design-by-chance. There's a little bit weird about it, but it makes sense. I used to find it hard to even remember how it works, but then I ha

Re: Templates - What's Up with the template keyword?

2019-04-10 Thread Ron Tarrant via Digitalmars-d-learn
On Wednesday, 10 April 2019 at 00:42:11 UTC, Ali Çehreli wrote: Your code did not work because Point is not a type but a type template. (On the other hand, Point!double is a type). The whole program: Thanks very much, Ali! Obviously, I've got some studying ahead of me.

DRuntime arguments

2019-04-10 Thread Cym13 via Digitalmars-d-learn
Where can I find a list of all druntime arguments supported? Things like --DRT-covopt='merge:1' or --DRT-gcopt='gc:profile=1' are not easy to guess and I can't find any centralized documentation.

Re: Templates - What's Up with the template keyword?

2019-04-10 Thread Ron Tarrant via Digitalmars-d-learn
On Wednesday, 10 April 2019 at 00:22:47 UTC, Ali Çehreli wrote: On 04/08/2019 05:23 AM, Ron Tarrant wrote: > But in "Programming in D," (self, 2009-2018) by Ali Çehreli, there's no > mention of the 'template' keyword in any of his examples. 'template' keyword is introduced here: http://ddil

Re: Templates - What's Up with the template keyword?

2019-04-10 Thread Ron Tarrant via Digitalmars-d-learn
On Tuesday, 9 April 2019 at 20:48:45 UTC, Steven Schveighoffer wrote: The thing that made it click for me is that a template is very akin to a macro substitution -- where you just copy and paste the given parameter wherever its substitute is found. Nicely put. Thanks, Steve. I at least get t

Re: Overloads not returning appropriate info. [Field reflunkory]

2019-04-10 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Apr 10, 2019 at 02:22:35AM +, Adam D. Ruppe via Digitalmars-d-learn wrote: > On Tuesday, 9 April 2019 at 21:00:55 UTC, H. S. Teoh wrote: > > (And on a side note: don't even get me started on is(...) > > expressions.) > > is expressions rock. And I betcha if we did do libraries for the

Re: Iterate/sort associative array by value?

2019-04-10 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-04-08 08:31:33 +, Dennis said: As Sebastian said, you can do `import std.experimental.all;` or from version 2.086 `import std;` to import the entire standard library. Well, that's more like a brute force approach. So it would be always best to use "import *" :-) I like selective

Re: Iterate/sort associative array by value?

2019-04-10 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-04-08 08:29:24 +, Julian said: It does do this, so the question should be: why aren't its warnings more extensive? Ok, I had the impression that I saw such a message in the past but wasn't sure about it... -- Robert M. Münch http://www.saphirion.com smarter | better | faster