Steel Bank Common Lisp

DEFSTRUCT should signal error/warning if :PREDICATE + :TYPE without :NAMED

Reported by Tobias C. Rittweiler on 2010-02-11
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Low
Unassigned

Bug Description

CLHS says

  A predicate can be defined only if the structure is named;
  if :type is supplied and :named is not supplied, then
  :predicate must either be unsupplied or have the value nil.

Yet SBCL compiles

(defstruct (typed-struct (:type list) (:predicate typed-struct-p))
  (a 42 :type fixnum))

silently, and it seems to ignore the :PREDICATE clause.

Changed in sbcl:
status: New → Confirmed
importance: Undecided → Low

The patch for this problem, with the regression test.

tags: added: review
Changed in sbcl:
assignee: nobody → Nikodemus Siivola (nikodemus)
status: Confirmed → In Progress
Nikodemus Siivola (nikodemus) wrote :

Doesn't handle

  (defstruct (foo (:type list) (:predicate nil)))

correctly.

tags: removed: review
Nikodemus Siivola (nikodemus) wrote :

Adjusted patch in my pending tree.

tags: added: pending
Nikodemus Siivola (nikodemus) wrote :

In 1.0.46.9.

Changed in sbcl:
assignee: Nikodemus Siivola (nikodemus) → nobody
status: In Progress → Fix Committed
tags: removed: pending
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers