Matt Diephouse skribis 2004-06-30 20:51 (-0400):
my $string = "Hello, World!"; say $string[0..4]; # prints "Hello\n" $string[7...] = "Larry!"; say $string; # prints "Hello, Larry!\n"
And that "array" is one of bytes? graphemes?
I'm not really up on my unicode, but I think .chars is what I have in mind. I want it to operate like a non-unicode string in Perl 5. Anything unicode can be more complex, as I think this will be the common case.
In general, I like the idea. In <[EMAIL PROTECTED]>, almost the same was suggested, but implemented differently: a string's .bytes method in list context (but isn't it array context, technically?) would dwym. As would the other parts-of-string methods.
Think of this as Huffmanized .chars then?
matt