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

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

Bug Description

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.)

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.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers