Re: question on dub and postgresql

2020-10-07 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Oct 07, 2020 at 07:15:42PM +, aberba via Digitalmars-d-learn wrote: [...] > It seems the D ecosystem is not immediately obvious to some people. > Dub, compilers, and IDEs are recurring issues. This is stuff that needs to be documented up-front and in-your-face. For example, if we're go

Re: question on dub and postgresql

2020-10-07 Thread aberba via Digitalmars-d-learn
On Monday, 5 October 2020 at 09:05:16 UTC, Alaindevos wrote: On Monday, 5 October 2020 at 08:54:39 UTC, Daniel Kozak wrote: On Mon, Oct 5, 2020 at 10:25 AM Alaindevos via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: [...] Yes and no. Dub is Dlang dependency solution but i

Re: If and isType with arrays

2020-10-07 Thread DMon via Digitalmars-d-learn
On Wednesday, 7 October 2020 at 16:39:07 UTC, Paul Backus wrote: On Wednesday, 7 October 2020 at 16:25:33 UTC, DMon wrote: Can isType be used as a condition in an if statement with arrays? You can do this with `is()` and `typeof()`: if (is(typeof(a) == int[5])) { write("true"); } The exa

Re: If and isType with arrays

2020-10-07 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 7 October 2020 at 16:25:33 UTC, DMon wrote: Can isType be used as a condition in an if statement with arrays? import std.stdio; import std.traits; void main() { int[5] a = [1,2,3,4,5]; // Something like this: if (a == isType!(int[5])) { write("true"); }

If and isType with arrays

2020-10-07 Thread DMon via Digitalmars-d-learn
Can isType be used as a condition in an if statement with arrays? import std.stdio; import std.traits; void main() { int[5] a = [1,2,3,4,5]; // Something like this: if (a == isType!(int[5])) { write("true"); } // This works: if (a[0] == isType!(int)) { w

Wanted! Tree Node implementation.

2020-10-07 Thread Виталий Фадеев via Digitalmars-d-learn
Wanted! Tree Node implementation. Like a: mixin template TreeNode( T ) { T parent; T firstChild; T lastChild; T prevSibling; T nextSibling; // ForwardRange implementation @property T front() { ... } @property bool empty() { ... } void popFront() { ... }

Re: Efficient sort function allowing own test and swap function as parameter

2020-10-07 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 6 October 2020 at 22:18:39 UTC, Alaindevos wrote: I have a large table consisting of two columns.One with words.Another with frequencies. I want to sort them efficiently according to the names or frequency. For this I need an efficient sort function where I can plugin my proper test

Re: Efficient sort function allowing own test and swap function as parameter

2020-10-07 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 7 October 2020 at 00:08:06 UTC, Ali Çehreli wrote: On 10/6/20 3:18 PM, Alaindevos wrote: [...] I had fun writing the following program. Note how makeIndex allows visiting elements in sorted order without actually sorting them. [...] Nice use of iota!