On 27 April 2012 07:20, Helmut Eller<eller.helmut@gmail.com> wrote:
From a philosophical point of view, type declarations in Lisp don't
change the semantics, i.e. a program with declarations should produce
the same results as the program without (though it could be more
efficient or give extra warnings). It's also in line with tradition to
emit a warning at compile time but still generate code that will raise
an runtime error. IMO Kawa acts quite gracefully here.
My problem with this philosophy, or at least Kawa's interpretation of
it, is that it leaves us with inconsistent error messages. For
instance,
(let ((x :: integer 10.5))
(+ x 1))
couple of warning, and then a type error. This is nice.
(let ((x :: gnu.lists.Sequence 10))
(car x))
couple of warnings, and then a ClassCastException, this isn't so nice IMO.