[swift-evolution] [Draft] Abolish IUO type

Chris Lattner clattner at apple.com
Thu Mar 17 18:47:13 CDT 2016


> On Mar 17, 2016, at 4:42 PM, Cheyo Ximenez via swift-evolution <swift-evolution at swift.org> wrote:
> 
> I'd like something with the word optional in it:
> @iuoptional 
> @unoptional // proposed new name for iuo :)
> @nonoptional 

The problem with this line of naming is that (in the new model) the value is already an optional.  This is making the already-existing optional auto-unwrap itself.

-Chris

> 
> 
> On Mar 17, 2016, at 1:38 PM, Chris Willmore via swift-evolution <swift-evolution at swift.org> wrote:
> 
>>> On Mar 17, 2016, at 6:53 AM, Brent Royal-Gordon <brent at architechies.com> wrote:
>>> 
>>>> 1. We have to add @implicitly_unwrapped attribute to the proposal. I hate implied "attributes", available only to compiler. The wording needs to be reformulated in terms of this attribute
>>> 
>>> Agree.
>>> 
>>>> 2. We need to encourage using the attribute instead of `!`.
>>>> 3. In the future, `!` can be removed entirely and leave only the attribute. But not for now
>>> 
>>> Disagree. As I mentioned earlier in the thread, IUOs are going to become less common on Apple platforms, but they are here to stay in Swift as a whole.
>> 
>> I agree with this.
>>> 
>>>> In order to do this, I suggest finding a concise name for it. Like @IUO, but possibly more readable
>>> 
>>> I do agree that we should look for a shorter, better name. I suggest `@autounwrap`, by analogy with `@autoclosure`. Both features insert invisible syntax at usage sites to make an expression of one type appear to be an expression of a different type.
>>> 
>>> (Actually, I think that `@autoclosure` is a great analogy for this feature in many respects.)
>> 
>> The similarity to @autoclosure is a good observation.
>> 
>> It sounds like an explicit attribute name may be a necessary part of this proposal rather than a thought for the future. So far we’ve heard:
>> 
>> @implicitly_unwrapped
>> @iuo
>> @autounwrap
>> 
>> — Chris Willmore
>> _______________________________________________
>> swift-evolution mailing list
>> swift-evolution at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-evolution
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list