Boost logo

Boost :

From: Thorsten Ottosen (nesotto_at_[hidden])
Date: 2002-10-10 10:37:13


> > the right one. One could choose to support both, though. The problem of
> > missing a value in the assignment to the map is hypothetical. If I wan't
> > to map int to int, I can make the mapping just as clear by using newline
> > or tabs:
> >
> > set_map( m ) += 1,2 2,3 3,4 5,6;
> >
> > set_map( m ) += 1,2
> > 2,3
> > 3,4;
> >
> > The first version is the best. One would never miss a value that way and
the
> > values are easier to read than something burried in paranthesis:
> >
> > init( m )(1,2)(2,3)(3,4);
>
> Personally, I prefer the parentheses -- the tuples are immediately
> visible. It's downright non-intuitive to use whitespace as a tuple
> separator.
>
> Dave

perhaps. I will add both syntaxes for the map stuff to make you happy. I
normally don't think about seperating the tuples (pairs). I think
the important aspekt was to see what was mapped to what. The parenthesis
will make this somewhat harder: a '(' disturbs the reading far more than a
','.. What good is it to
be able to see the pairs if you can't see what's in them? The initial
concern was that values could be mapped to the wrong values.
The question is if its good to support both these syntaxes:

m += 1,2;
init( m )(2,4);

? An alternative. For those who want paranthesis I could provide something
like

m += _(1,2), _(2,3);

by makeing a class '_'?

regards

-Thorsten


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