std.experimental.collections.rcstring and its integration in Phobos

sarn sarn at theartofmachinery.com
Thu Jul 19 00:29:16 UTC 2018


On Wednesday, 18 July 2018 at 12:03:02 UTC, Eugene Wissner wrote:
> Therefore it shouldn't compile at all, but
>
> rcstring("ä")[].split("|")
>
> or
>
> rcstring("ä").byCodePoint.split("|")

+1 to requiring an explicit byCodeUnit or whatever.

For every "obvious" way to interpret a string as a range, you can 
find an application where the obvious code is surprisingly buggy.

(BTW, rcstring("ä").byCodePoint.split("|") is buggy for 
characters made of multiple codepoints.  Canonicalisation doesn't 
fix it because many characters just don't have a single-codepoint 
form.)


More information about the Digitalmars-d mailing list