finish function for output ranges

Russel Winder russel at winder.org.uk
Sun Aug 12 00:41:20 PDT 2012


On Sat, 2012-08-11 at 19:29 -0400, Andrei Alexandrescu wrote:
[…]
> I think (2) is a much more fertile view than (1) because the notion of 
> "reduce" emphasizes the accumulation operation (such as "+"), and that 
> is a forced notion for hashes (we're not really adding stuff there). In 
> contrast, the notion that the hash accumulator is a sink is very 
> natural: you just dump a lot of stuff into the accumulator, and then you 
> call finish and you get its digest.

One could also consider the hash generator to be a builder, which would
support 2 rather than 1.

-- 
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: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120812/be6306b5/attachment.pgp>


More information about the Digitalmars-d mailing list