[racket] fl vs. unsafe-fl

From: Sam Tobin-Hochstadt (samth at cs.indiana.edu)
Date: Tue Sep 2 12:05:45 EDT 2014

On Tue, Sep 2, 2014 at 11:53 AM, Dmitry Pavlov <dpavlov at ipa.nw.ru> wrote:
>
>
>> The best thing about Typed Racket is that you can delegate that
>>
>> problem. Not only do you not need to write unsafe-fl+, you don't even
>> need to write fl+. You can write +. Typed Racket will determine if +
>> can safely be replaced with unsafe-fl+. (Assuming you typed things as
>> Float a.k.a. Flonum, FlVector, &c.)
>
>
> I agree with you; however, I think I am in an unlucky situation.
> I actually have to write code that works with flonums or (optionally)
> with extflonums. As Extflonums are not part of the numeric tower,
> Typed Racket will not allow me to use "+" instead of "extfl+".


But `fl+` and `unsafe-fl+` also do not work on Extflonums, so you
should be able to use TR and then just replace uses of unsafe-fl+ with
+ as appropriate, and your extfl+ will still be there.

Sam

Posted on the users mailing list.