[swift-evolution] Arrays and Optionals

Marc Knaup marc at knaup.koeln
Tue Dec 15 06:28:44 CST 2015

Hey Sean,

Jordan Rose answered this question yesterday in a different discussion:

On Tue, Dec 15, 2015 at 1:08 PM, Sean Kosanovich via swift-evolution <
swift-evolution at swift.org> wrote:

> Hello all!
> I have been using Swift nearly exclusively for iOS projects since its
> release (for better or worse).  I love the fact that a compiling
> application gives me some sort of guarantee that I won’t encounter a nil
> reference (unless of course I ignore optionals and force unwrap them…not a
> great idea).
> When pulling values out of a Dictionary, we get an Optional value which
> makes perfect sense.  Why does this not extend out to Arrays?  There is no
> guarantee that when I am pulling the 8th element out, that it will have a
> valid value.
> It seems odd to me that Optionals are a fundamental part of the language
> but they don’t extend to Arrays.
> Thanks,
> Sean
> _______________________________________________
> 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/20151215/8be4adb3/attachment.html>

More information about the swift-evolution mailing list