[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Argument Type Mismatch Errors

    Unofficially:  An implementation obviously should detect and signal
    errors when convenient.  The primary force against always doing so is
    run-time efficiency.  Personally, I feel that once an implementation
    detects an error such as an inappropriate argument type, it should
    always signal the error rather than silently proceeding.  There's no
    reason not to signal the error, assuming the price of detecting it has
    already been paid.

I disagree with this slightly.  In some cases the book says "is an
error" rather than "signals an error" because we recognized that on some
machines it might be costly to detect and signal certain errors.  But in
other cases, the motivation was to allow flexibility for experimenting
with non-standard language extensions.  So I can certainly imagine some
situations in which an implementation detects an error but deliberately
goes on to do something other than signalling the error.  The existence
of such extensions should not be taken as a license for sloppy
implementation, however: extensions of this sort should be carefully
considered and should be well-documented.

-- Scott