[swift-evolution] [swift-evolution-announce] [Review] SE-0080: Failable Numeric Conversion Initializers

Colin Barrett colin at springsandstruts.com
Wed May 4 22:19:22 CDT 2016


Thanks Matthew. Personally I would really like to see an analysis of the tradeoffs therein covered in the proposal in some way.

-Colin (via thumbs)

> On May 4, 2016, at 8:23 PM, Matthew Johnson <matthew at anandabits.com> wrote:
> 
> 
>>> On May 4, 2016, at 6:56 PM, Colin Barrett via swift-evolution <swift-evolution at swift.org> wrote:
>>> 
>>> Swift numeric types all currently have a family of conversion initializers. In many use cases they leave a lot to be desired. Initializing an integer type with a floating point value will truncate any fractional portion of the number. Initializing with an out-of-range value traps.
>> 
>> 
>> Have you considered whether it makes sense to keep these around? Maybe the failable ones should be the default, and give the other ones a more descriptive 1st argument label.
> 
> That’s a good question.  It might be a good idea, but I wanted to keep this proposal small and non-breaking to maximize chances of acceptance.  I would support that change to the proposal if the core team was interested in going that direction.
> 
>> 
>> -Colin
>> _______________________________________________
>> 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