decodeReverse

Jakob Ovrum via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 6 00:09:57 PST 2015


On Tuesday, 6 January 2015 at 06:43:13 UTC, HaraldZealot wrote:
> For my particular project (it binds with something like finite 
> state machine) I will write some counterpart of decode function 
> from std.utf. Future function will decode string backward, 
> return dchar and change index passed by reference.
>
> Is it interesting for community that I code this feature in 
> general way targeting in phobos for future?

For UTF, there's already std.utf.strideBack which does most of 
the work. I don't know why there is no std.utf.decodeBack - 
should be very simple to wrap over strideBack.

However, for grapheme clusters, there isn't yet a counterpart for 
std.uni.graphemeStride/decodeGrapheme, which notably affects 
std.uni.byGrapheme, which is currently not a bidirectional range. 
Any improvement would be much appreciated.


More information about the Digitalmars-d mailing list