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

Matthew Johnson matthew at anandabits.com
Wed May 4 19:23:18 CDT 2016


> 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