Boost logo

Boost :

Subject: Re: [boost] [Review Results] Range.Ex library accepted into boost
From: Arno Schödl (aschoedl_at_[hidden])
Date: 2009-05-04 10:46:38


> 5: naming convention for the adaptor generators
> ===============================================

> Many people like to be able to say make_transform_range(r,fun)
> instead of r | transformed( fun ). There was no concensus
> on how to name these functions. Here are some candidates:
>
> make_transform_range( r, fun )
> transformed( r, fun )
> transform( r, fun ) (*)
> transform_view( r, fun )
>
> (*) was dislike by some because it has exactly the same spelling as
> the algorithm transform. Many felt that the confusion is
> too big if view generators are not named different from the actual
> algorithms.

Irrespective of the pro and cons of this notation, I think putting the fun (or whatever other parameters there are in addition to the range) to the beginning, like make_transform_range( fun, r ), is a good idea to allow good readability of long chains. Chaining was one of the main arguments in favor of the pipe |, so allowing good chainability of the free function syntax is probably worthwhile.

Arno

--
Dr. Arno Schoedl · aschoedl_at_[hidden] 
Technical Director 
 
think-cell Software GmbH · Invalidenstr. 34 · 10115 Berlin, Germany 
http://www.think-cell.com · phone +49-30-666473-10 · toll-free (US) +1-800-891-8091
Directors: Dr. Markus Hannebauer, Dr. Arno Schoedl · Amtsgericht Berlin-Charlottenburg, HRB 85229

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk