On Thu, 2016-10-13 at 02:33 +0000, Meta via Digitalmars-d-learn wrote:
> On Thursday, 13 October 2016 at 01:15:22 UTC, Andrei Alexandrescu 
> wrote:
> > On 10/06/2016 10:32 AM, Nordlöw wrote:
> > > Is there a concept in D similar to Rust's `collect`:
> > > 
> > > https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.col
> > > lect
> > 
> > That's "make" in std.container. Is that what you're looking 
> > for? As an aside, "collect" is an awful abbreviation of 
> > "collection". -- Andrei
> 
> I've always thought of it more as "collect the elements of the 
> iterator into a container".

Java and Rust have gone the same route. collect is a terminal operation
creating a data structure given a potentially infinite, lazily
evaluated, stream. Rust uses iter for creating a stream from a data
structure, Java uses stream or parallelstream. Java's parallelstream
seems to be missing from Rust, but there is Rayon to provide a version.
D's std.parallelism does something of this, but it needs more work to
provide the tree-structured as well as scatter–gather internal
parallelism models.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.win...@ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: rus...@winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to