decodeReverse

HaraldZealot via Digitalmars-d digitalmars-d at puremagic.com
Tue Jan 6 12:30:47 PST 2015


On Tuesday, 6 January 2015 at 16:58:24 UTC, Andrei Alexandrescu 
wrote:
> On 1/5/15 10:43 PM, 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?
>
> back() and popBack() for narrow strings do reverse decode. -- 
> Andrei

I need reverse decode from any position, not only from the last.
I have coded a litle with stideBack allready, it works. But usage 
isn't clear as could: first strideBack, then decode, and decode 
move index forward, then I have to strideBack again :)

Perhaps i will wrap such algorithm in some function, but an other 
side i will be forced to optimize that and write real decodeBack 
function.



More information about the Digitalmars-d mailing list