
Boost : 
Subject: Re: [boost] Naming convention of iterated binary operation
From: Louis Dionne (ldionne.2_at_[hidden])
Date: 20160502 13:50:09
Dear list entities,
> is there such a convention or precedent for naming an iterated binary
> operation?
>
> For example, Boost.Functional/Hash has an iterated hash() called
> hash_range(). I don't mind the "_range" suffix but I prefer the
> "iterated_"
> prefix based on the mathematical definition:
> https://en.wikipedia.org/wiki/Iterated_binary_operation
FWIW, and you might already know that, but the functions F_l and F_r in the
Wikipedia article you linked are sometimes called
F_l: fold_left
foldl
fold
accumulate
F_r: fold_right
foldr
reverse_fold
This is probably a personal bias from mathematics, but using the iterated_
prefix makes me think that it could be this kind of iteration
hash(hash(hash(hash(x))))
Of course the above makes no sense for a binary operation, but this is what
the name alone means to me.
Bottom line: I don't think there's a convention, and if there's one, it's
not well known. Good luck, naming is hard :)
Louis
 View this message in context: http://boost.2283326.n4.nabble.com/Namingconventionofiteratedbinaryoperationtp4685795p4685806.html Sent from the Boost  Dev mailing list archive at Nabble.com.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk