Actually, I would probably do what Matthew did and coerce to a float with exact->inexact, which would error instead of crashing. [Although a complex value, for example, would get through that and still crash.] But, the idea of having unchecked/unsafe operations is to ONLY call them when the data has already been through some contract check already.<br>
<br><div class="gmail_quote">On Sat, Oct 3, 2009 at 12:40 PM, Robby Findler <span dir="ltr"><<a href="mailto:robby@eecs.northwestern.edu">robby@eecs.northwestern.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
If the operations in the science collection have the loops inside<br>
them, then it probably wouldn't hurt to add a check at boundary and<br>
you can make them safe, even thought the depend on the unsafe<br>
operations.<br>
<br>
Robby<br>
<br>
On Sat, Oct 3, 2009 at 11:33 AM, Doug Williams<br>
<div class="im"><<a href="mailto:m.douglas.williams@gmail.com">m.douglas.williams@gmail.com</a>> wrote:<br>
</div><div><div></div><div class="h5">> And, given your post on the JIT optimizations for unsafe operations, I can<br>
> see where they are truly unsafe (in terms of possibly crashing instead of<br>
> just erroring.) When I make the changes to use the unsafe-fl/unsafe-fx<br>
> operations, I'll change to using unsafe- as a prefix for the science<br>
> collection operations.<br>
><br>
> Doug<br>
><br>
> On Sat, Oct 3, 2009 at 10:33 AM, Matthew Flatt <<a href="mailto:mflatt@cs.utah.edu">mflatt@cs.utah.edu</a>> wrote:<br>
>><br>
>> At Sun, 6 Sep 2009 18:59:01 -0600, Doug Williams wrote:<br>
>> > Would it be better to call<br>
>> > the operations 'unchecked-<whatever>' instead of 'unsafe-<whatever>'?<br>
>> > Generally, we are calling the function because we know it is safe to<br>
>> > avoid<br>
>> > some constraint check - not because it is unsafe. Just a nit.<br>
>><br>
>> Despite the distinction between unsafety for performance and unsafety<br>
>> to get at new things, I like having all unsafe operations marked the<br>
>> same way. Also, "unchecked" doesn't sound dangerous enough to me.<br>
>><br>
>> So, you make a good point, but I'm still in favor of "unsafe".<br>
>><br>
><br>
><br>
</div></div></blockquote></div><br>