Changeset 9185


Ignore:
Timestamp:
05/16/05 15:58:12 (16 years ago)
Author:
piso
Message:

getDocumentation(), setDocumentation(), getPropertyList(), setPropertyList()

File:
1 edited

Legend:

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

    r8977 r9185  
    33 *
    44 * Copyright (C) 2002-2005 Peter Graves
    5  * $Id: LispObject.java,v 1.129 2005-04-23 18:57:07 piso Exp $
     5 * $Id: LispObject.java,v 1.130 2005-05-16 15:58:12 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    480480    {
    481481        return false;
     482    }
     483
     484    public LispObject getDocumentation(LispObject docType)
     485        throws ConditionThrowable
     486    {
     487        LispObject propertyList = getPropertyList();
     488        if (propertyList != null) {
     489            LispObject alist = getf(propertyList, Symbol._DOCUMENTATION, NIL);
     490            if (alist != null) {
     491                LispObject entry = assq(docType, alist);
     492                if (entry instanceof Cons)
     493                    return ((Cons)entry).cdr;
     494            }
     495        }
     496        return NIL;
     497    }
     498
     499    public void setDocumentation(LispObject docType, LispObject documentation)
     500        throws ConditionThrowable
     501    {
     502        LispObject propertyList = getPropertyList();
     503        if (propertyList != null) {
     504            LispObject alist = getf(propertyList, Symbol._DOCUMENTATION, NIL);
     505            if (alist == null)
     506                alist = NIL;
     507            LispObject entry = assq(docType, alist);
     508            if (entry instanceof Cons) {
     509                ((Cons)entry).cdr = documentation;
     510            } else {
     511                alist = alist.push(new Cons(docType, documentation));
     512                setPropertyList(putf(propertyList, Symbol._DOCUMENTATION, alist));
     513            }
     514        }
     515    }
     516
     517    public LispObject getPropertyList()
     518    {
     519        return null;
     520    }
     521
     522    public void setPropertyList(LispObject obj)
     523    {
    482524    }
    483525
Note: See TracChangeset for help on using the changeset viewer.