July 20, 2016
On Wednesday, 20 July 2016 at 13:33:34 UTC, Mike Parker wrote:
> There is no auto-decoding going on here, as char[] and wchar[] are rejected outright since they are not considered random access ranges.

They are considered random access ranges by my ranges library, because they are treated as arrays of characters and not as unicode strings.
July 20, 2016
On Wednesday, 20 July 2016 at 16:03:27 UTC, pineapple wrote:
> On Wednesday, 20 July 2016 at 13:33:34 UTC, Mike Parker wrote:
>> There is no auto-decoding going on here, as char[] and wchar[] are rejected outright since they are not considered random access ranges.
>
> They are considered random access ranges by my ranges library, because they are treated as arrays of characters and not as unicode strings.

On second thought that's not even relevant - the linked-to module performs an out-of-place shuffle and so does not even require the input range to have random access.
July 20, 2016
On Wednesday, 20 July 2016 at 16:04:50 UTC, pineapple wrote:
> On Wednesday, 20 July 2016 at 16:03:27 UTC, pineapple wrote:
>> On Wednesday, 20 July 2016 at 13:33:34 UTC, Mike Parker wrote:
>>> There is no auto-decoding going on here, as char[] and wchar[] are rejected outright since they are not considered random access ranges.
>>
>> They are considered random access ranges by my ranges library, because they are treated as arrays of characters and not as unicode strings.
>
> On second thought that's not even relevant - the linked-to module performs an out-of-place shuffle and so does not even require the input range to have random access.

Pardon my being scatterbrained (and there not being an "edit post" function) - you're referring to phobos not considering char[] and wchar[] to have random access? The reason they are not considered to have random access is because they are auto-decoded by other functions that handle them, and the auto-decoding makes random access inefficient. Not because shuffleRandom itself auto-decodes them.
July 20, 2016
On Wednesday, 20 July 2016 at 16:08:26 UTC, pineapple wrote:

>
> Pardon my being scatterbrained (and there not being an "edit post" function) - you're referring to phobos not considering char[] and wchar[] to have random access? The reason they are not considered to have random access is because they are auto-decoded by other functions that handle them, and the auto-decoding makes random access inefficient. Not because shuffleRandom itself auto-decodes them.

The relevant lines I quoted from the docs above explain quite clearly that it's because they are multi-byte formats. Indexing them is not inefficient, it simply makes no sense. What does it mean to take the value at index i when it is part of a multi-byte sequence that continues at index i+1? Auto-decoding has nothing to do with it.
July 20, 2016
On Wednesday, 20 July 2016 at 13:33:34 UTC, Mike Parker wrote:
> There is no auto-decoding going on here,
...

> as char[] and wchar[] are rejected outright since they are not considered random access ranges.
...due to autodecoding.
July 20, 2016
On 07/20/2016 06:18 PM, Mike Parker wrote:
> The relevant lines I quoted from the docs above explain quite clearly
> that it's because they are multi-byte formats. Indexing them is not
> inefficient, it simply makes no sense. What does it mean to take the
> value at index i when it is part of a multi-byte sequence that continues
> at index i+1? Auto-decoding has nothing to do with it.

Without auto decoding, char[] would (most probably) be a random access range of code units. Taking the value at index i would return the code unit at index i, like it does for the array.

It's not that way, because narrow strings are decoded by the range primitives (auto decoding).
July 20, 2016
On 07/20/2016 09:44 AM, ketmar wrote:
> On Wednesday, 20 July 2016 at 13:33:34 UTC, Mike Parker wrote:
>> There is no auto-decoding going on here,
> ...
>
>> as char[] and wchar[] are rejected outright since they are not
>> considered random access ranges.
> ...due to autodecoding.

I think both not being random access ranges and there is auto-decoding in Phobos are design decisions due to the fact that char[] is a multi-byte encoding.

Phobos could choose not to auto-decode but char[] would still be multi-byte, making it impossible to access randomly.

Ali

July 20, 2016
On Wednesday, 20 July 2016 at 17:31:18 UTC, Ali Çehreli wrote:
> I think both not being random access ranges and there is auto-decoding in Phobos are design decisions due to the fact that char[] is a multi-byte encoding.
>
> Phobos could choose not to auto-decode but char[] would still be multi-byte, making it impossible to access randomly.

but it does happen that we have autodecoding, and non-random-access char ranges, and it is clearly tied. so, leaving aside "what if..." things, we can say that it is autodecoding issue. ;-)
July 20, 2016
On Wednesday, 20 July 2016 at 17:31:18 UTC, Ali Çehreli wrote:
> making it impossible to access randomly

making it impossible to access randomly __correctly__, unless you're safely assuming there's only ASCII in your string.
July 20, 2016
On 07/20/2016 10:40 AM, Jack Stouffer wrote:
> On Wednesday, 20 July 2016 at 17:31:18 UTC, Ali Çehreli wrote:
>> making it impossible to access randomly
>
> making it impossible to access randomly __correctly__, unless you're
> safely assuming there's only ASCII in your string.

Yes, perhaps I should have said "making it not meaningful to access randomly" (in general, as you note).

Ali