[perl #124455] substr on compact array

2017-10-02 Thread Timo Paulssen via RT
Also, the design docs say you get the same kind of buffer back from substr on a buf, but we have subbuf for that now.

[perl #124455] substr on compact array

2017-10-02 Thread Timo Paulssen via RT
The tests are bogus just the assumption that a substr of length 8 will give you 8 bits rather than 8 bytes, that's already wildly inconsistent with what substr does otherwise. really this code looks like the desire to have `vec` from perl5 implemented in perl6 by re-using the substr name. I thi

[perl #124455] substr on compact array

2017-10-01 Thread Aleks-Daniel Jakimenko-Aleksejev via RT
Oh wow, that's really interesting… and old. I don't think that substr should work like this. Normal arrays are stringified by 「substr」, why would it do something completely different for a native array? So for both UInt and uint8 arrays I'd expect “65 66 67” as an output. I think this ticket is r

[perl #124455] substr on compact array

2015-05-12 Thread Will Coleda via RT
3 tests here that need fixing or review: my uint8 @buffer = ('A' .. 'Z').map({ .ord }); is(substr(@buffer, 0, 8), ord('A'), 'substr on compact array (1)'); is(substr(@buffer, 200, 8), ord('Z'), 'substr on compact array (2)'); is( substr(@buffer, 0, 16), sprintf('%