Boost logo

Boost :

From: Aleksey Gurtovoy (alexy_at_[hidden])
Date: 2001-06-30 14:56:51


David Abrahams wrote:
> While we're exploring that path, we could get even more Pythonic:
>
>
> format(" $1 $2 $3") % tuple(x, y z))
>
> or, heck, fully pythonic:
>
> " $1 $2 $3" % tuple(x, y z)
>
> or, less Pythonically:
>
> format(" $1 $2 $3", tuple(x, y, z));

I like this one. However, it actually should be:

format(" $1 $2 $3", make_tuple(x, y, z));

and this is already less attractive, at least for me. Still, I think it's a
move in the right direction :).

>
> At least these keep all the combinatorics in one place (tuple).
> Incidentally, until we get a core language way to remove the
> combinatorics, I like the repeated '%' operator.

My main problem with '%' is that it's not an idiomatic C++, at least not yet
:). Also, using of '$' in format specification, but '%' when providing
arguments seems inconsistent.

Aleksey


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