Boost logo

Boost :

Subject: Re: [boost] [review][assign] Formal review of Assign v2 ongoing
From: er (er.ci.2020_at_[hidden])
Date: 2011-06-20 18:18:42


>
> For some reason the code examples for this library remind me of ruby, in that when I first saw ruby code it was completely unreadable.

I'm not sure the pipe, dot and comma usage is really intuitive, nor csv.
  I'm pretty good at guessing TLA meanings, but csv meant nothing to me
until I saw "comma seperated values" somewhere in the tutorial or
something. "csv_" might as well be "_", it would be shorter and just as
intuitive. "put" is at least intuitive. I think "values" would be more
intuitive than csv and if it were me I'd probably name csv<2>
"value_pairs", but then I don't mind typing. Typing time should not
correlate to productivity. Longer names don't increase code complexity.
  It isn't clear to me that the library syntax reduces code complexity.
>

These are useful comments, thanks.

Would this be a viable alternative?

a) Variadic form, unchanged:

put( cont )( args1 ... )... (argsn... );

b) As a replacement for csv_put<I>(), where I represents a fixed arity

put<I>( cont, a1,...,aI, ..., z1, ..., zI );

c) Abandon the basic form csv_put() (no integer template) overload
altogether.

d) The pipe syntax then becomes:
cont | _do_put.for_each( range );
cont | _do_put.for_each<I>( range_tuples );
cont | do_put<I>( a1,...,aI, ..., z1, ..., zI );

About your other comments:
- operator| has a similar meaning in Boost.Range under adaptors.
- Feel free to suggest another prefix than 'do'.
- Dot is borrowed from Boost.Assign (1.0).
- There are no comma operators anymore.
- Prefix _ is reserved for const objects (not sure the proper word for it)

HTH, and will give some thought to your other questions.


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