Changeset 5697


Ignore:
Timestamp:
02/04/04 17:23:35 (17 years ago)
Author:
piso
Message:

MAKE-INSTANCE: check for odd number of keyword arguments.

File:
1 edited

Legend:

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

    r5666 r5697  
    22;;;
    33;;; Copyright (C) 2003-2004 Peter Graves
    4 ;;; $Id: clos.lisp,v 1.60 2004-02-02 18:34:55 piso Exp $
     4;;; $Id: clos.lisp,v 1.61 2004-02-04 17:23:35 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    14471447
    14481448(defmethod make-instance ((class standard-class) &rest initargs)
     1449  (when (oddp (length initargs))
     1450    (error 'program-error
     1451           :format-control "Odd number of keyword arguments."))
    14491452  (let ((class-default-initargs (class-default-initargs class)))
    14501453    (when class-default-initargs
    1451       (let ((default-initargs ())
    1452             (not-found (gensym)))
     1454      (let ((default-initargs ()))
    14531455        (do* ((list class-default-initargs (cddr list))
    14541456              (key (car list) (car list))
    14551457              (fn (cadr list) (cadr list)))
    14561458             ((null list))
    1457           (when (eq (getf initargs key not-found) not-found)
     1459          (when (eq (getf initargs key 'not-found) 'not-found)
    14581460            (setf default-initargs (append default-initargs (list key (funcall fn))))))
    14591461        (setf initargs (append initargs default-initargs)))))
Note: See TracChangeset for help on using the changeset viewer.