Re: Concatenation/joining strings together in a more readable way

2019-12-29 Thread Marcone via Digitalmars-d-learn
On Wednesday, 25 December 2019 at 13:07:44 UTC, mipri wrote: On Wednesday, 25 December 2019 at 12:39:08 UTC, BoQsc wrote: Are there any other ways to join two strings without Tilde ~ character? I can't seems to find anything about Tilde character concatenation easily, nor the alternatives to

Re: What kind of Editor, IDE you are using and which one do you like for D language?

2019-12-29 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Dec 29, 2019 at 09:25:44PM +, Adam D. Ruppe via Digitalmars-d-learn wrote: > On Sunday, 29 December 2019 at 14:41:46 UTC, Russel Winder wrote: > > Whilst many programmers are happy using 1970s approaches > > Please. Have you actually spent the time to learn these systems in the >

Re: What kind of Editor, IDE you are using and which one do you like for D language?

2019-12-29 Thread bachmeier via Digitalmars-d-learn
On Sunday, 29 December 2019 at 14:41:46 UTC, Russel Winder wrote: Whilst many programmers are happy using 1970s approaches to programming using ed, ex, vi, vim, emacs, sublime text, atom, etc. Many programmers prefer using IDEs, and are better programmers for it. I don't think it's black

Re: Mimicking a shell

2019-12-29 Thread angel via Digitalmars-d-learn
On Sunday, 29 December 2019 at 17:03:14 UTC, Jan wrote: Hi, Is there a way to forward all input and output from a shell? This implies that e.g. pressing the left arrow on the keyboard is immediately being forwarded to the shell and that the output from a shell would be *exactly* the same as

Re: What kind of Editor, IDE you are using and which one do you like for D language?

2019-12-29 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 29 December 2019 at 14:41:46 UTC, Russel Winder wrote: Whilst many programmers are happy using 1970s approaches Please. Have you actually spent the time to learn these systems in the last 40 years? My experience is IDEs are just different, not necessarily better or worse. Just

Re: Mimicking a shell

2019-12-29 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 29 December 2019 at 17:03:14 UTC, Jan wrote: Is there a way to forward all input and output from a shell? yes, but it is platform specific and can be a decent amount of code. what OS are you on?

Mimicking a shell

2019-12-29 Thread Jan via Digitalmars-d-learn
Hi, Is there a way to forward all input and output from a shell? This implies that e.g. pressing the left arrow on the keyboard is immediately being forwarded to the shell and that the output from a shell would be *exactly* the same as output from my D program (that would include the prompt

Re: What kind of Editor, IDE you are using and which one do you like for D language?

2019-12-29 Thread p.shkadzko via Digitalmars-d-learn
On Sunday, 29 December 2019 at 14:41:46 UTC, Russel Winder wrote: The more the D community advertise that IDEs are for wimps, the less likelihood that people will come to D usage. It is so. And yet, I can't use Java or Scala without IDE and I tried. I believe the same is true for C++.

Re: What kind of Editor, IDE you are using and which one do you like for D language?

2019-12-29 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2019-12-28 at 22:01 +, p.shkadzko via Digitalmars-d-learn wrote: […] > p.s. I found it quite satisfying that D does not really need an > IDE, you will be fine even with nano. Java people said this and we got Eclipse, Netbeans, and IntelliJ IDEA, and many people were better Java (and

Re: What type does byGrapheme() return?

2019-12-29 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-12-27 19:44:59 +, H. S. Teoh said: Since graphemes are variable-length in terms of code points, you can't exactly *edit* a range of graphemes -- you can't replace a 1-codepoint grapheme with a 6-codepoint grapheme, for example, since there's no space in the underlying string to

Re: Mergesort not working

2019-12-29 Thread SimonN via Digitalmars-d-learn
On Sunday, 29 December 2019 at 11:02:34 UTC, Adnan wrote: while (arr1_idx < arr1.length && arr2_idx < arr2.length) result ~= arr1[arr1_idx] < arr2[arr2_idx] ? arr1[arr1_idx++] : arr2[arr2_idx++]; Given an array, it just returns a 1 length array. What's causing this? This loop

Mergesort not working

2019-12-29 Thread Adnan via Digitalmars-d-learn
This is not entirely a D question, but I'm not sure what about my mergesort implementation went wrong. T[] merge(T)(T[] arr1, T[] arr2) { T[] result; result.reserve(arr1.length + arr2.length); ulong arr1_idx = 0, arr2_idx = 0; while (arr1_idx < arr1.length && arr2_idx <

Re: Finding position of a value in an array

2019-12-29 Thread Ron Tarrant via Digitalmars-d-learn
On Sunday, 29 December 2019 at 09:44:18 UTC, MoonlightSentinel wrote: On Sunday, 29 December 2019 at 08:31:13 UTC, mipri wrote: On Sunday, 29 December 2019 at 08:26:58 UTC, Daren Scot Wilson wrote: int i = a.countUntil!(v => v == 55); assert(i == 2); A predicate isn’t required, countUntil

Re: Finding position of a value in an array

2019-12-29 Thread MoonlightSentinel via Digitalmars-d-learn
On Sunday, 29 December 2019 at 08:31:13 UTC, mipri wrote: On Sunday, 29 December 2019 at 08:26:58 UTC, Daren Scot Wilson wrote: Reading documentation... Array, Algorithms, ... maybe I've been up too late... how does one obtain the index of, say, 55 in an array like this int[] a =

Re: What type does byGrapheme() return?

2019-12-29 Thread Robert M. Münch via Digitalmars-d-learn
On 2019-12-27 17:54:28 +, Steven Schveighoffer said: This is the rub with ranges. You need to use typeof. There's no other way to do it, because the type returned by byGrapheme depends on the type of Range. Hi, ok, thanks a lot and IMO these are the fundamental important information for

Re: Finding position of a value in an array

2019-12-29 Thread mipri via Digitalmars-d-learn
On Sunday, 29 December 2019 at 08:26:58 UTC, Daren Scot Wilson wrote: Reading documentation... Array, Algorithms, ... maybe I've been up too late... how does one obtain the index of, say, 55 in an array like this int[] a = [77,66,55,44]; I want to do something like: int i =

Finding position of a value in an array

2019-12-29 Thread Daren Scot Wilson via Digitalmars-d-learn
Reading documentation... Array, Algorithms, ... maybe I've been up too late... how does one obtain the index of, say, 55 in an array like this int[] a = [77,66,55,44]; I want to do something like: int i = a.find_value_returning_its_index(55); assert(i==2) I'm sure it's obvious