Changeset 10254


Ignore:
Timestamp:
10/28/05 12:40:20 (16 years ago)
Author:
piso
Message:

getDocumentation(), setDocumentation(): use a global hash-table instead of the object's property list.

File:
1 edited

Legend:

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

    r9870 r10254  
    33 *
    44 * Copyright (C) 2002-2005 Peter Graves
    5  * $Id: LispObject.java,v 1.146 2005-08-15 23:25:38 piso Exp $
     5 * $Id: LispObject.java,v 1.147 2005-10-28 12:40:20 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    522522    }
    523523
     524    private static final EqHashTable documentationHashTable =
     525        new EqHashTable(11, NIL, NIL);
     526
    524527    public LispObject getDocumentation(LispObject docType)
    525528        throws ConditionThrowable
    526529    {
    527         LispObject propertyList = getPropertyList();
    528         if (propertyList != null) {
    529             LispObject alist = getf(propertyList, Symbol._DOCUMENTATION, NIL);
    530             if (alist != null) {
    531                 LispObject entry = assq(docType, alist);
    532                 if (entry instanceof Cons)
    533                     return ((Cons)entry).cdr;
    534             }
     530        LispObject alist = documentationHashTable.get(this);
     531        if (alist != null) {
     532            LispObject entry = assq(docType, alist);
     533            if (entry instanceof Cons)
     534                return ((Cons)entry).cdr;
    535535        }
    536536        return NIL;
     
    540540        throws ConditionThrowable
    541541    {
    542         LispObject propertyList = getPropertyList();
    543         if (propertyList != null) {
    544             LispObject alist = getf(propertyList, Symbol._DOCUMENTATION, NIL);
    545             if (alist == null)
    546                 alist = NIL;
    547             LispObject entry = assq(docType, alist);
    548             if (entry instanceof Cons) {
    549                 ((Cons)entry).cdr = documentation;
    550             } else {
    551                 alist = alist.push(new Cons(docType, documentation));
    552                 setPropertyList(putf(propertyList, Symbol._DOCUMENTATION, alist));
    553             }
     542        LispObject alist = documentationHashTable.get(this);
     543        if (alist == null)
     544            alist = NIL;
     545        LispObject entry = assq(docType, alist);
     546        if (entry instanceof Cons) {
     547            ((Cons)entry).cdr = documentation;
     548        } else {
     549            alist = alist.push(new Cons(docType, documentation));
     550            documentationHashTable.put(this, alist);
    554551        }
    555552    }
Note: See TracChangeset for help on using the changeset viewer.