[swift-evolution] Proposal: failable numeric conversion initializers

Matthew Johnson matthew at anandabits.com
Mon Dec 7 13:04:36 CST 2015


I personally don't care what the argument label is (or even if this functionality is achieved through other means as Chris indicated a preference for).  I just want the language to support failable numeric conversions in some way or another.  

That said, if we do add such initializers and IEEE has a terminology for this it seems like a no-brainier to use it.

Sent from my iPad

> On Dec 7, 2015, at 12:21 PM, Stephen Canon via swift-evolution <swift-evolution at swift.org> wrote:
> 
> If we’re going to bikeshed (😀), I have a strong preference for “exact” for this usage.  There would need to be a good reason to diverge from the widely-used IEEE 754 terminology.
> 
>> On Dec 7, 2015, at 12:50 PM, Dmitri Gribenko via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> On Mon, Dec 7, 2015 at 7:49 AM, thorsten at portableinnovations.de
>> <thorsten at portableinnovations.de> wrote:
>>> The throwing ones might use "strict", or something similar, i.e.
>>> 
>>> init(strict value: Int64) throws
>> 
>> Well, choosing that word is very important :)  "strict" does not imply
>> "throwing" to me, FWIW, it is more like "lossless" than "throwing".
>> 
>> Dmitri
>> 
>> -- 
>> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
>> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
>> _______________________________________________
>> 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