Changeset 2580

Show
Ignore:
Timestamp:
02/21/08 06:54:33 (11 months ago)
Author:
hans
Message:

Make sure that exactly one slot is passed to the class index as
indexed slot.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bknr/datastore/src/indices/indices.lisp

    r2529 r2580  
    2222              :documentation "If T, NIL is used as a valid slot value, else slots with NIL value are treated as unbound slots."))) 
    2323 
    24 (defmethod initialize-instance :after ((index slot-index) &key (test #'eql) slots index-nil &allow-other-keys) 
    25   (unless (<= (length slots) 1) 
    26     (error "Can not create slot-index with more than one slot.")) 
     24(defmethod initialize-instance :after ((index slot-index) &key (test #'eql) slot-name slots index-nil) 
     25  (unless slots 
     26    (setf slots (list slot-name))) 
     27  (unless (= (length slots) 1) 
     28    (error "Exactly one slot name in :SLOTS initarg required to create a SLOT-INDEX")) 
    2729  (with-slots (hash-table slot-name) index 
    2830    (setf hash-table (make-hash-table :test test)