Issue DEFINE-CONDITION-SLOT-NAME
Issue: DEFINE-CONDITION-SLOT-NAME

Forum: Editorial

References: DEFINE-CONDITION

Category: CLARIFICATION/CHANGE

Edit history: 2004-07-20, Version 1 by Bruno Haible

Status: For CLiki consideration

Problem Description:

In DEFINE-CONDITION, the syntax where slot-name is "the list of a slot-name" or "the list of slot name/slot form pairs" seem redundant, given :initform. Was it left in by accident?

Proposal (DEFINE-CONDITION-SLOT-NAME:RESTRICT):

Change the description of Slot-name to "a slot name (a symbol)."

Test case:

(define-condition my-error (error) (((slot) :reader my-error-slot)))
(define-condition foo () ((((slot-name-symbol . "slot form")))))
(define-condition my-error (error) (((slot 77) :reader my-error-slot)))

Rationale:

The two other forms are redundant and not consistent with DEFCLASS.

Current practice:

CMUCL 18e, SBCL 0.8.9.46, and CLISP 2.33 reject such constructs.

Cost to Implementors:

Tiny.

Cost to Users:

None: The redundant forms were not accepted by the implementations anyway,

Cost of Non-Adoption:

Redundant spec.

Benefits:

Consistency between DEFINE-CONDITION and DEFCLASS.

Aesthetics:

Discussion:
  • Bruno Haible supports proposal RESTRICT.