[Ecls-list] Status of CVS

Tobias C. Rittweiler tcr at freebits.de
Tue May 13 08:44:44 UTC 2008


"Juan Jose Garcia-Ripoll" writes:

> Perhaps, but that also shows the code is broken. So it can be
> understood as a debugging tool, but given that it is not specified in
> the standard as a portable behavior, I find it really annoying that
> programmers rely on that instead of using their own check-type forms.

There _is_ a difference between using declarations-as-assertions and
using explicit CHECK-TYPE forms: type propagation.

  (defun foo1 (s)
    (declare (type symbol x))
    (frob s))

  (defun foo2 (s)
    (check-type s symbol)
    (frob s))

A compiler can safely assume that FOO1's parameter has the type SYMBOL,
while it must resort to give FOO2's parameter the type T. Assuming that
type violations will be checked for statically, the first way is
obviously superior, especially during development.

  -T.





More information about the ecl-devel mailing list