[swift-evolution] Arrays and Optionals
marc at knaup.koeln
Tue Dec 15 06:28:44 CST 2015
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.
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution