Changeset 5027


Ignore:
Timestamp:
12/08/03 15:39:41 (17 years ago)
Author:
piso
Message:

SLOT-LOCATION: cache location after we've figured it out once.

File:
1 edited

Legend:

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

    r5026 r5027  
    22;;;
    33;;; Copyright (C) 2003 Peter Graves
    4 ;;; $Id: clos.lisp,v 1.12 2003-12-08 14:58:34 piso Exp $
     4;;; $Id: clos.lisp,v 1.13 2003-12-08 15:39:41 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    160160  readers
    161161  writers
    162   allocation)
     162  allocation
     163  location)
    163164
    164165(defun make-direct-slot-definition (&rest properties
     
    354355
    355356(defun slot-location (class slot-name)
    356   (let ((slot (find slot-name (class-slots class)
    357                     :key #'slot-definition-name)))
     357  (let ((slot (find slot-name (class-slots class) :key #'slot-definition-name)))
    358358    (if slot
    359         (position slot (remove-if-not #'instance-slot-p (class-slots class)))
     359        (let ((location (slot-definition-location slot)))
     360          (if location
     361              location
     362              (setf (slot-definition-location slot)
     363                    (position slot (remove-if-not #'instance-slot-p (class-slots class))))))
    360364        nil)))
    361365
Note: See TracChangeset for help on using the changeset viewer.