[C++-sig] GNU gettext and "_"

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Thu Jun 20 18:45:55 CEST 2002


--- David Abrahams <david.abrahams at rcn.com> wrote:
> From: "Ralf W. Grosse-Kunstleve" <rwgk at yahoo.com>
> 
> > --- David Abrahams <david.abrahams at rcn.com> wrote:
> > > I'm working on slicing now and I find myself in need of a way to
> represent
> > > x[:y]. This is technically not equivalent to x[0:y] since you can slice
> on
> > > any type. "Obviously", the answer is to use
> > >
> > >     x.slice(_,y)
> >
> > x.slice(open_interval_left(y))
> > x.slice(open_interval_right(y))
> 
> Yikes, Ralf!

It wouldn't really work for [::] anyway.

> The whole point of this is that it should be convenient and
> mirror Python syntax!

I am having real difficulties seeing the usefulness of the "mirror Python
syntax" approach, especially if you threaten to mess around with defines in
questionable ways. Why would I want to write Python in C++? If I want
convenience I use Python, and if I need speed I use (pure/real/familiar) C++.
Writing Python in C++ is a bit like trying to be half pregnant. IMO this is
sending the wrong signals and will lead to the wrong expectations.

> If we have to, I would prefer:
> 
>     x.slice(y,z)
>     x.slice_from(y)
>     x.slice_to(z)
>

This I like a lot.

> though
> 
>     x.slice(y,_)
>     x.slice(_,z)
> 
> seems much clearer to me.

Not to me, FWIW.
 
Ralf


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com





More information about the Cplusplus-sig mailing list