Comment 0 for bug 327537

Revision history for this message
Tobias C. Rittweiler (tcr) wrote : wished: DESTRUCTURING-BIND to signal note on arg-count-error at compile-time

The following does not emit a compiler-note

  (deftype list-of-length (n &optional type)
    (if (zerop n)
        `null
        `(cons ,type (list-of-length ,(1- n)))))

  (declaim (ftype (function (t t) (list-of-length 2)) bar))
  (defun bar (x y)
    (list x y))

  (defun foo ()
    (destructuring-bind (x y z) (bar 1 2)
      (list :x x :y y :z z)))

The reason is lacking compiler-smartness for sb-int:proper-list-of-length-p.

(When fixing this, the changset from 1.0.19.30 may have to be reconsidered.)