[swift-evolution] [Pitch] Adding safety to arrays

Xiaodi Wu xiaodi.wu at gmail.com
Thu Apr 13 19:22:22 CDT 2017


A proposal for lenient subscripts has already been written, and a PR has
been created on the swift-evolution repo and it has been closed for not
being in scope. When it is in scope, it can be considered again. But in the
meantime, the topic has been visited so many times that it's extremely
unlikely for anything previously unsaid to be newly discovered at this
point.


On Thu, Apr 13, 2017 at 7:11 PM, David Sweeris via swift-evolution <
swift-evolution at swift.org> wrote:

>
> > On Apr 13, 2017, at 15:01, Tony Allevato <tony.allevato at gmail.com>
> wrote:
> >
> > My 2 cents: Giving users checked subscripts for arrays will do more harm
> than good for novice programmers—they're going to do the wrong thing with
> them.
>
> I'm torn... On the one hand, I see the logic in this. On the other hand, I
> suspect many developers will end up writing such a function anyway
> (regardless of whether it's a good idea), and it'd be nice if there was a
> standard spelling.
>
> I realize this is not a convincing argument; I'm just thinking out loud a
> bit...
>
> Maybe I'll start a "StdBadIdeasLib" project, for all the ideas that could
> be implemented straightforwardly on top of the existing stdlib, but get
> rejected because they're bad ideas... Come to think of it, that's probably
> a bad idea itself (at least it'd be a well-named library, though).
>
> - Dave Sweeris
> _______________________________________________
> 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/20170413/d06513fa/attachment.html>


More information about the swift-evolution mailing list