Rust-like collect in D

Russel Winder via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Oct 12 22:09:38 PDT 2016


On Wed, 2016-10-12 at 21:15 -0400, Andrei Alexandrescu via Digitalmars-
d-learn 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.colle
> > ct
> 
> 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's say collect has an interesting history. Smalltalk used collect for
what other called map. Various languages, including Groovy, continued
this tradition. Now Rust and Java are using collect as a verb-like
form, just as D uses make. collection would be wrong here.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at winder.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20161013/f7af01fd/attachment.sig>


More information about the Digitalmars-d-learn mailing list