FFI Report comments

Alastair David Reid reid at cs.utah.edu
Tue Aug 21 13:30:42 EDT 2001

Malcolm writes:
> Now that we have the opportunity to define a sensible overflow
> behaviour for fixed size types, I think we should take it.

I strongly support Malcolm's proposal.
(Which is, of course, to maintain the status quo.)

I can think of 2 situations where we would not want this:

1) We want to get errors when overflow occurs.

   Fix: define new types with this behaviour.  The modular behaviour
   is useful in its own right.

   But note that it'd be more useful for such types to support
   Pascal-style range checks since it's much more common for my code
   to contain integers whose range is limited to 0..999 (say) than for
   the range boundaries to be powers of 2.

2) You want to use a non-binary representation (e.g., Hugs implements
   Integer as base 10000 numbers).

   Fix: None needed - choosing such a representation doesn't prevent
   you from implementing the specified semantics (though it may be
   intensely painful or very inefficient).

Alastair Reid        reid at cs.utah.edu        http://www.cs.utah.edu/~reid/

More information about the FFI mailing list