[swift-evolution] [Proposal] More lenient half-open range operator (was: [Proposal] Safer half-open range operator)

Luis Henrique B. Sousa lshsousa at gmail.com
Wed Apr 27 16:31:31 CDT 2016


Thanks Dave. I couldn't find a better word before. That's why I had written
a note there previously: "The label *safe* is just an idea, it might be
improved as it does not sound very appropriate in this context". :-)

I've updated the document removing references to safety. I don't really
know if "lenient" is the best label for the subscript method, but it does
sound more appropriate:
*https://github.com/luish/swift-evolution/commit/7edd2e0173586e8e2864f598a27f3e42c0f849c2
<https://github.com/luish/swift-evolution/commit/7edd2e0173586e8e2864f598a27f3e42c0f849c2>*

New link to the proposal (file renamed):
https://github.com/luish/swift-evolution/blob/more-lenient-subscripts/proposals/nnnn-more-lenient-collections-subscripts.md

- Luis

On Wed, Apr 27, 2016 at 9:26 PM, Dave Abrahams via swift-evolution <
swift-evolution at swift.org> wrote:

>
> on Wed Apr 27 2016, "Luis Henrique B. Sousa via swift-evolution" <
> swift-evolution at swift.org> wrote:
>
> > Actually I had already modified the initial proposal to introduce those
> new
> > subscripts methods.
> >
> > It is here now: (any help to improve that is very welcome)
> >
> https://github.com/luish/swift-evolution/blob/safer-collection-subscripts/proposals/nnnn-safer-collections-subscript-methods.md
> >
> > As the motivation and *problem* addressed remain the same, should I
> really
> > create a new thread?
>
> I dunno, but IMO you should change the title of this thread and the
> proposal and the keywords therein.  It's not about making indexing
> safer, at least not in the sense we use the term “safety” around Swift.
> Array indexing is currently perfectly memory- and type-safe in the
> absence of race conditions.  You're talking about making it more lenient
> with respect to bounds checks.
>
> > Best regards,
> >
> > - Luis
> >
> > On Wed, Apr 27, 2016 at 12:17 PM, Maximilian Hünenberger
> > <m.huenenberger at me.com> wrote:
> >
> >     Do you change the proposal to introduce new (default) subscripts to
> >     CollectionType/ RangeReplacableCollectionType?
> >
> >     subscript(safe index: Index) -> Element?
> >     subscript(truncate range: Range<Index>) -> SubSequence
> >
> >     Maybe a new proposal would be appropriate (and a new thread).
> >
> >     Best regards
> >     - Maximilian
> >
> >
> > _______________________________________________
> > swift-evolution mailing list
> > swift-evolution at swift.org
> > https://lists.swift.org/mailman/listinfo/swift-evolution
>
> --
> Dave
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160427/48db321d/attachment.html>


More information about the swift-evolution mailing list