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

Error Checking in SUBSEQ

I feel strongly that it is a bad idea to spend effort looking for
weird ways to interpret meaningless arguments to functions.  The only        
advantage to this is that it increases the functionality of CL without
increasing the number of functions in it, a dubious advantage.
This amounts to the same thing as "overloading operators" in more ugly
(i.e. traditional) programming languages, which is known to make it
hard for compilers and programmers.
It is much better to define new functions (or syntactically distinguishable
variants, such as :FROM-END) for new functionality.  This allows the
programmer to tell the compiler/computer much more about his intended
use of the function.  This enables the language implementor to support
more fine-grained error checking, and better compilations.
Several years ago while I was working on the editor for NIL, the unlderlying
error checking facilities were improved.  This showed several cases
where I had called %STRING-SUBSEQ as if it took (string start end)
arguments, instead of (string start count) arguments.  I don't
remember what effect this had, but the bug had been there for a long time.

As far as I am concerned it is better to decrease functionality so that
error checking can be improved than to increase functionality at the
expense of error checking.  Error checking is our friend.