Isn't using find with retro awkward?

Andrej Mitrovic andrej.mitrovich at gmail.com
Mon Feb 14 21:14:18 PST 2011


On 2/15/11, Jonathan M Davis <jmdavisProg at gmx.com> wrote:
>
> Of _course_ you get a reversed range back. You _reversed the range_. That's
> what
> retro _does_. If you use it with find, of _course_ you're going to get a
> reversed
> range back. Complaining about that is like complaining that your range is
> sorted
> after you sorted it. It did exactly what it's supposed to do.

You're not reading my posts properly. I /know/ that. That's why I've
put a comment there that using retro doesn't make sense. Sheesh!

My concern is that in the documentation it states "if you want to find
the last match use retro". I believe this can bite newcommers to D if
they don't know the fact that they'll get back a reversed range. It
just says "use retro", it doesn't mention what retro does. It does
link to it, that's okay, but will people read the retro documentation
or will they just jump to conclusions and think retro does its magic
and find just returns a range as usual?

Regardless of that documentation, I'm thinking lastFind might be of
use. But I'd like to hear more opinions before I blindly open a
feature request.


More information about the Digitalmars-d-learn mailing list