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

Argument Type Mismatch Errors



Is there any agreement as to what a CL system should do when a type
error occurs?  What I am thinking about are things like append, which
specifies that all arguments (except) the last are to be lists.  If one
element is not a list should an error occur?  In Hedrick's Dec-20 CL, it
does cause an error.  Since the standard doesn't say that an error is
required, couldn't one write a legal implementation of CL where it ignores
the offending argument?  Along similar lines is our PCLS implementation of the
package system.  Packages are implemented as defstructs, so if a non
package argument is passed to a function that expect the package, our
system currently causes an error as it tries to access a field in the
defstruct (defstructs are vectors so the error message says something like
illegal to index non vector `bar').  At least in this case it gets an error,
although one that could be confusing to the programmer.  [The obvious
reason for not type checking that the argument is in fact a package
defstruct is because of efficiency.]

Thanks.
Bob.
-------