Alex Bowers wrote on 20/03/2015 13:10:

    $array['x':'z'] = []; // Remove all elements with keys between 'x'
    and 'z', inclusive


I believe i mentioned in the past about strings not being allowed for ranges, since there is no real way to check this (and this appears to be by key not by index) which should be a separate RFC thread, assuming this one gets accepted to be expanded upon.

I'm carrying over my syntax from previous examples - [a:b] meaning a key-based slice (which implies accepting string keys, because there's no reason not to) vs [@a:b] meaning a positional slice. See my earlier mail on the 6 different types of access - I do realise you're not planning to implement them all, just playing with the implications of different decisions if we carry them through consistently in the future.

Regards,
--
Rowan Collins
[IMSoP]

Reply via email to