Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2001-05-28 10:31:45


On Monday 28 May 2001 01:16 am, you wrote:
[snip]
> Ahh OK. you mean 'ambiguity' from the client's perspective.
> OK, load and clear.
>
> Pardon my inquisitive nature. How about:
>
> a[8]; // exactly 8 times
> a[0, more]; // you said can be done, i believe so (comma (,) op)
> a[0, until(15)]; // likewise can be done
>
> we can even have:
>
> a[from(0), until(10)] for people who prefer verbosity.
>
> Why the fuss? I want iteration to be very distinct from grouping. Too many
> parentheses make the code quite difficult to read except for lisp/scheme
> folks.
>
> Thanks,
> Joel de Guzman

I'm a bit over-paranoid when it comes to syntax that will compile but run in
an unexpected manner. By allowing the first three mentioned above, it's
_really_ easy for a user to forget the "until" and write a[0, 15] instead of
a[0, until(15)] - and the two are totally different. Some compilers warn
about this, but it could perhaps be considered an "embarrassment", akin to
"vector<list<int>>" but without any compile-time error.

        Doug


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