Re: A little help with Ranges

2021-08-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/27/21 12:41 AM, Merlin Diavova wrote: On Friday, 27 August 2021 at 04:01:19 UTC, Ali Çehreli wrote: On 8/26/21 7:17 PM, Merlin Diavova wrote: [...] Then the operations downstream will not produce any results. For example, the array will be empty below: import std.stdio; import

Re: A little help with Ranges

2021-08-26 Thread Merlin Diavova via Digitalmars-d-learn
On Friday, 27 August 2021 at 04:01:19 UTC, Ali Çehreli wrote: On 8/26/21 7:17 PM, Merlin Diavova wrote: [...] Then the operations downstream will not produce any results. For example, the array will be empty below: import std.stdio; import std.range; import std.algorithm; import

Re: A little help with Ranges

2021-08-26 Thread Ali Çehreli via Digitalmars-d-learn
On 8/26/21 7:17 PM, Merlin Diavova wrote: What I meant about the handling an empty filter is, what if I want to take an alternative route if the filter returns empty? Then the operations downstream will not produce any results. For example, the array will be empty below: import std.stdio;

Re: A little help with Ranges

2021-08-26 Thread Stefan Koch via Digitalmars-d-learn
On Friday, 27 August 2021 at 02:17:21 UTC, Merlin Diavova wrote: On Friday, 27 August 2021 at 02:10:48 UTC, Stefan Koch wrote: On Friday, 27 August 2021 at 01:51:42 UTC, Merlin Diavova wrote: Hi all, I'm Merlin, I'm just starting out in D and super excited. My questions are:- 1. In a range

Re: A little help with Ranges

2021-08-26 Thread Merlin Diavova via Digitalmars-d-learn
On Friday, 27 August 2021 at 02:10:48 UTC, Stefan Koch wrote: On Friday, 27 August 2021 at 01:51:42 UTC, Merlin Diavova wrote: Hi all, I'm Merlin, I'm just starting out in D and super excited. My questions are:- 1. In a range pipeline how does one handle the event of a filter range

Re: A little help with Ranges

2021-08-26 Thread Stefan Koch via Digitalmars-d-learn
On Friday, 27 August 2021 at 01:51:42 UTC, Merlin Diavova wrote: Hi all, I'm Merlin, I'm just starting out in D and super excited. My questions are:- 1. In a range pipeline how does one handle the event of a filter range returning empty? 2. How does one unwrap a single result from a range

A little help with Ranges

2021-08-26 Thread Merlin Diavova via Digitalmars-d-learn
Hi all, I'm Merlin, I'm just starting out in D and super excited. My questions are:- 1. In a range pipeline how does one handle the event of a filter range returning empty? 2. How does one unwrap a single result from a range operation? Look forward to your assistance! Merlin