On Mon, 2009-09-28 at 23:25 -0400, Aubrey Jaffer wrote:
> | From: Ray Dillinger <[email protected]>
>  | Date: Mon, 28 Sep 2009 20:10:27 -0700

>  | With bignums limited by the size of machine memory, the dire
>  | failure condition (particularly easy to hit with rationals) is that
>  | the execution of your program consumes all memory and aborts or
>  | crashes.  The pernicious part is that the system may not even have
>  | room to open a debugger to handle the abort.
> 
> That the program crashes is the result of poor coding practice.  A
> single comparison operation in the subroutine which allocates a bignum
> can signal an informative exception with plenty of main memory
> available for the debugger.

I recognize that, but strictly speaking, *any* of these numerical errors
could be prevented, or at least exchanged for some other, with some type
of coding practice.  

When it matters, I even write "guarded multiply" in portable c (which is
comparable to the modular-semantics-with-no-error-reporting case) by
dividing the result by one of the multiplicands and asserting that it's
equal to the other. There's nothing special about the bignum case in
regards to the error being a result of failure of coding practices. 

The question then becomes, what "coding practice" do we want to force on
(and explain to) new users of scheme and what kind of errors do we want 
them to have to deal with (and understand) when they fail to do so?

                                Bear



_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss

Reply via email to