[swift-evolution] [Review] SE-0093: Adding a public base property to slices

Max Moiseev moiseev at apple.com
Mon May 23 17:15:26 CDT 2016


Hi Kevin,

Thanks for reviewing this proposal.

It is my poor choice of words to be blamed for the confusion. There is definitely no reason for the new property to only be available for the MutableRandomAccessSlice type. Moreover, since all the slice types are generated with GYB now, it would be more code ;-)

The intention is to add the new property to ALL the slice types.

Regards,
Max


> On May 23, 2016, at 3:08 PM, Kevin Ballard via swift-evolution <swift-evolution at swift.org> wrote:
> 
> On Thu, May 19, 2016, at 04:43 PM, Dave Abrahams via swift-evolution wrote:
>> 	* What is your evaluation of the proposal?
> 
> The motivation sounds reasonable, as does the solution. But it seems odd to expose a property `base` on MutableRandomAccessSlice without exposing it on any other slice type. I'd much rather expose it everywhere, ideally by renaming the `_base` property as suggested in the alternatives section. Stdlib breakage can be handled on a temporary basis by providing the `_base` accessor as a computed property that returns `base`, though of course the goal should be to remove this entirely (or hopefully not have it at all if there's not too much stdlib breakage). And such a change should still be purely additive from the perspective of third-party code.
> 
>> 	* Is the problem being addressed significant enough to warrant a
>>          change to Swift?
> 
> Yes. This is a relatively minor change but it allows for better performance.
> 
>> 	* Does this proposal fit well with the feel and direction of
>>          Swift?
> 
> Yes.
> 
>> 	* If you have used other languages or libraries with a similar
>>          feature, how do you feel that this proposal compares to those?
> 
> I can't think of any languages with this offhand.
> 
>> 	* How much effort did you put into your review? A glance, a
>>          quick reading, or an in-depth study?
> 
> A quick reading.
> 
> -Kevin Ballard
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list