[swift-evolution] guard let x = x

Greg Parker gparker at apple.com
Mon Oct 31 20:06:23 CDT 2016


> On Oct 31, 2016, at 3:46 PM, William Sumner via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Your proposed form of unwrap naturally works in multiple places with clear readability:
> 
> var foo: Any?
> if unwrap foo {}
> 
> while unwrap foo {}
> 
> guard unwrap foo else { return }

And perhaps plain old:

unwrap! foo  
// i.e. guard unwrap foo else { crash }


-- 
Greg Parker     gparker at apple.com <mailto:gparker at apple.com>     Runtime Wrangler


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161031/348d9f1b/attachment.html>


More information about the swift-evolution mailing list