[armedbear-cvs] r13750 - trunk/abcl/src/org/armedbear/lisp

mevenson at common-lisp.net mevenson at common-lisp.net
Tue Jan 10 20:11:28 UTC 2012


Author: mevenson
Date: Tue Jan 10 12:11:27 2012
New Revision: 13750

Log:
Fix #172: DOCUMENTATION now works for generic functions.

LispObject.java didn't know that things other than Function could be
in a symbol's function slot.

# From: Rudolf Schlatte <rudi at constantly.at>
# Subject: [armedbear-devel] Patch for bug 172
# Date: January 10, 2012 8:54:16 PM GMT+01:00

Modified:
   trunk/abcl/src/org/armedbear/lisp/LispObject.java

Modified: trunk/abcl/src/org/armedbear/lisp/LispObject.java
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/LispObject.java	Tue Jan 10 12:11:14 2012	(r13749)
+++ trunk/abcl/src/org/armedbear/lisp/LispObject.java	Tue Jan 10 12:11:27 2012	(r13750)
@@ -658,7 +658,7 @@
           return ((Cons)entry).cdr;
       }
     if(docType == Symbol.FUNCTION && this instanceof Symbol) {
-        Object fn = ((Symbol)this).getSymbolFunction();
+        LispObject fn = ((Symbol)this).getSymbolFunction();
         if(fn instanceof Function) {
             DocString ds = fn.getClass().getAnnotation(DocString.class);
             if(ds != null) {
@@ -670,6 +670,10 @@
                     SimpleString doc = new SimpleString(docstring);
                     ((Symbol)this).setDocumentation(Symbol.FUNCTION, doc);
                     return doc;
+                } else if (fn instanceof StandardGenericFunction) {
+                    return 
+                        StandardGenericFunction.checkStandardGenericFunction(fn)
+                        .slots[StandardGenericFunctionClass.SLOT_INDEX_DOCUMENTATION];
                 }
             }
         }




More information about the armedbear-cvs mailing list