wanted: DESTRUCTURING-BIND to signal note on arg-count-error at compile-time

Bug #327537 reported by Tobias C. Rittweiler on 2009-02-10
Affects Status Importance Assigned to Milestone
Douglas Katzman

Bug Description

The following does not emit a compiler-note

  (deftype list-of-length (n &optional type)
    (if (zerop n)
        `(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 may have to be reconsidered.)

description: updated
Changed in sbcl:
importance: Undecided → Wishlist
status: New → Confirmed
Changed in sbcl:
assignee: nobody → Tobias C. Rittweiler (tcr)
Jan Moringen (scymtym) wrote :

Some initial experiments based on suggestions by pkhuong can be found at https://github.com/scymtym/sbcl/tree/wip-smarter-destructuring-bind.

Douglas Katzman (dougk) on 2015-06-11
Changed in sbcl:
assignee: Tobias C. Rittweiler (tcr) → Douglas Katzman (dougk)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers