DEFCLASS :METACLASS STRUCTURE-CLASS gives STLE-WARNINGS for function redefinitions

Bug #309446 reported by Nikodemus Siivola
2
Affects Status Importance Assigned to Milestone
SBCL
Confirmed
Low
Unassigned

Bug Description

(reported by Alexey Dejneka sbcl-devel 2002-08-04)

DEFCLASS does not inform the compiler about generated
     functions. Compiling a file with
       (DEFCLASS A-CLASS ()
         ((A-CLASS-X)))
       (DEFUN A-CLASS-X (A)
         (WITH-SLOTS (A-CLASS-X) A
           A-CLASS-X))
used to result in a STYLE-WARNING:
       undefined-function
         SB-SLOT-ACCESSOR-NAME::|COMMON-LISP-USER A-CLASS-X slot READER|

APD's fix for this was checked in to sbcl-0.7.6.20, but Pierre
Mai points out that the declamation of functions is in fact
incorrect in some cases (most notably for structure
classes). This means that at present erroneous attempts to use
WITH-SLOTS and the like on classes with metaclass STRUCTURE-CLASS
won't get the corresponding STYLE-WARNING.

[much later, in 2006-08] in fact it's no longer erroneous to use
WITH-SLOTS on structure-classes. However, including :METACLASS
STRUCTURE-CLASS in the class definition gives a whole bunch of
function redefinition warnings, so we're still not good to close
this bug:

CL-USER> (defclass myf () (x y z) (:metaclass structure-class))
STYLE-WARNING: redefining |MYF structure class constructor| in DEFUN
STYLE-WARNING:
   redefining (SB-PCL::SLOT-ACCESSOR MYF X SB-PCL::READER) in DEFUN
STYLE-WARNING:
   redefining (SB-PCL::SLOT-ACCESSOR MYF Y SB-PCL::READER) in DEFUN
STYLE-WARNING:
   redefining (SB-PCL::SLOT-ACCESSOR MYF Z SB-PCL::READER) in DEFUN
STYLE-WARNING:
   redefining (SB-PCL::SLOT-ACCESSOR MYF X SB-PCL::WRITER) in DEFUN
STYLE-WARNING:
   redefining (SB-PCL::SLOT-ACCESSOR MYF Y SB-PCL::WRITER) in DEFUN
STYLE-WARNING:
   redefining (SB-PCL::SLOT-ACCESSOR MYF Z SB-PCL::WRITER) in DEFUN
#<STRUCTURE-CLASS MYF>

Tags: pcl
description: updated
Changed in sbcl:
importance: Undecided → Low
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.