Boost logo

Boost :

From: Powell, Gary (powellg_at_[hidden])
Date: 2006-05-09 12:43:03


 
   Yours,
   -Gary-

------------------
powellg_at_[hidden]
 

> -----Original Message-----
> From: boost-bounces_at_[hidden]
> [mailto:boost-bounces_at_[hidden]] On Behalf Of Oleg Abrosimov
> Sent: Tuesday, May 09, 2006 8:06 AM
> To: boost_at_[hidden]
> Subject: Re: [boost] [review] Fusion review begins
>
> Ronald Garcia:
> > The review of Joel de Guzman's Fusion library begins today, May 1,
> > 2006, and continues through May 10, 2006.
>
> Hello!
>
> One note about fusion::tuple I/O manipulators:
>
> "The library defines three manipulators for changing the
> default behavior:
> Manipulators
> tuple_open(arg)
> Defines the character that is output before the first element.
> tuple_close(arg)
> Defines the character that is output after the last element.
> tuple_delimiter(arg)
> Defines the delimiter character between elements."
>
Oleg> "Example:
Oleg> std::cout << tuple_open('[') << tuple_close(']') << tuple_delimiter(",
Oleg> ") << a;"
>
Oleg> I see a usability issue here. I believe that if one needs to
Oleg> specify tuple_open then he would need to specify tuple_close too.
>
Oleg> I propose to change tuple manipulators to be:
>
Oleg> 1) tuple_bounds("(", ")") // if need to specify one bound, I
Oleg> need to specify both.
Oleg> 2) tuple_delimiter(",") // I'm happy with bounds, but
Oleg> delimiter should be specified.
Oleg> 3) tuple_punc("(", ",", ")") // I should specify all punctuation.
>

Hmmm. You may be right here, as there could be confusion from the following:

cout << tuple_open('[') << tuple_delimiter(';') << tuple(1,2) << tuple_close(']');

where it would output
[1;2)
instead of
[1;2]

>
Oleg> furthermore, I believe that these manipulators are more
Oleg> general. They could be used with any sequence, not only with tuples.
>
Oleg> May be it should be factored out to separate library and
Oleg> named appropriately?
>
Oleg> 1) seq_bounds("(", ")") // if need to specify one bound, I
Oleg> need to specify both.
Oleg> 2) seq_delimiter(",") // I'm happy with bounds, but delimiter
Oleg> should be specified.
Oleg> 3) seq_punc("(", ",", ")") // I should specify all punctuation.
>
Oleg> seq stands for sequence.
>

The issue is that if you use a facet to do punct, it's tied to the type of container.

I apologize for not looking at what the current code does, but the stuff I wrote orginally was tied directly to the tuples.

Also, you probably want to stick with 'C' not "C";
>
> Best,
> Oleg Abrosimov.
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>


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