Test cases and static typing

Henrik Motakef usenet-reply at henrik-motakef.de
Fri Oct 24 19:07:15 EDT 2003


Dirk Thierbach <dthierbach at gmx.de> writes:

> OTOH, Lisp certainly doesn't check types,

Ho hum. I realize that this is probably not what you meant, but given
the existence of usenet archives, I have to oppose this statement
anyway ;-)

Lisp implementations are not /required/ to check types at compile time
(they are at run time, when they encounter a CHECK-TYPE form), but
that doesn't neccessarily mean they don't.

Even if the CL type system isn't as friendly for such things as the
ones of Ocaml or Haskell may be (try proving whether a value is of
type (satisfies (lambda (x) (= x (get-universal-time))))[1] for a
start), some implementations really do honor you optional type
declarations, and even do some significant type inferencing. They
won't just abort compilation if they think you program could be
improved type-wise, but they will issue a warning, which is just as
good IMHO.

> OTOH, this example is tied to a specific Lisp debugger feature.

The Lisp debugger is a standardized part of the language, just like
the type system is.


[1] Yes, yes, you'll have to create a named function for that lambda
    expression in reality scince SATISFIES doesn't actually accept
    lambdas for some reason, but you get the point.




More information about the Python-list mailing list