Ticket #1017 (closed defect: invalid)

Opened 22 months ago

Last modified 22 months ago

Trifle in documentation: class definition slot args - readers writers

Reported by: p2 Owned by:
Priority: trivial Milestone:
Component: Documentation Version: trunk
Keywords: initarg readers writers Cc:

Description

My mistaken defclass threw up:

Error: :ACESSOR is an invalid initarg to INITIALIZE-INSTANCE for #<STANDARD-CLASS CCL:STANDARD-DIRECT-SLOT-DEFINITION>.

Valid initargs: (:NAME :TYPE :INITFUNCTION :INITFORM :INITARGS :ALLOCATION :DOCUMENTATION :CLASS :READERS :WRITERS).

While executing: CCL::CHECK-INITARGS,

Assume this should be :reader and :writer (not plural).

Change History

comment:1 Changed 22 months ago by rme

  • Status changed from new to closed
  • Resolution set to invalid

It's actually not a typo. If you have a copy of AMOP, see section 1.3.3 for an explanation of what's going on here.

 http://www.alu.org/mop/concepts.html#defclass might be a second choice.

In brief, the slot options from defclass are converted into a canonicalized slot specification (a plist), and the valid keys (for the default kind of slot) of that plist are what you're seeing in the error message above. During canonicalization, individual :reader and :writer options are consolidated, and passed as :readers and :writers.

I don't think that it's feasible for the defclass macro itself to report an error here: some custom slot might actually accept a slot option named ":acessor" or whatever.

Note: See TracTickets for help on using tickets.