If you know you're only dealing with ASCII, I think you're much better 
operating on an array of Uint8.

  -- John

On Oct 6, 2014, at 10:35 AM, Stefan Karpinski <[email protected]> wrote:

> On Mon, Oct 6, 2014 at 1:11 PM, John Myles White <[email protected]> 
> wrote:
> FWIW, I actually think strings shouldn't define indexing at all: they should 
> only define iteration.
> 
> There's a pretty strong argument to be made for that. The fact that you can 
> pretend that indices = characters if you happen to only care about ASCII 
> strings is the main reason we allowed indexing into strings at all. Of 
> course, maybe one shouldn't encourage writing code that only works for ASCII 
> strings, but it's a common case.
>  

Reply via email to