Changeset 5041


Ignore:
Timestamp:
12/10/03 02:34:47 (18 years ago)
Author:
piso
Message:

ENSURE-CLASS: check for duplicate argument names in :DEFAULT-INITARGS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/clos.lisp

    r5040 r5041  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: clos.lisp,v 1.21 2003-12-09 22:07:57 piso Exp $
     4;;; $Id: clos.lisp,v 1.22 2003-12-10 02:34:47 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    532532    (when (eq name1 (canonical-slot-name s2))
    533533            (error 'program-error "duplicate slot ~S" name1))))))
     534  ;; Check for duplicate argument names in :DEFAULT-INITARGS.
     535  (let ((names ()))
     536    (do* ((initargs (getf all-keys :direct-default-initargs) (cddr initargs))
     537          (name (car initargs) (car initargs)))
     538         ((null initargs))
     539      (push name names))
     540    (do* ((names names (cdr names))
     541          (name (car names) (car names)))
     542         ((null names))
     543      (when (memq name (cdr names))
     544        (error 'program-error
     545               "duplicate initialization argument name ~S in :DEFAULT-INITARGS"
     546               name))))
    534547  (let ((class (find-class name nil)))
    535548    (unless class
Note: See TracChangeset for help on using the changeset viewer.