[armedbear-devel] Patch for bug 172

Rudolf Schlatte rudi at constantly.at
Tue Jan 10 19:54:16 UTC 2012


Hi,

; SLIME 2012-01-06
CL-USER> (defgeneric foo (x) (:documentation "Hi there!"))
#<STANDARD-GENERIC-FUNCTION FOO {78189538}>
CL-USER> (documentation 'foo 'function)
"Hi there!"
CL-USER> 

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

Regards,

Rudi


Changes in HEAD
	Modified   src/org/armedbear/lisp/LispObject.java
diff --git a/src/org/armedbear/lisp/LispObject.java b/src/org/armedbear/lisp/LispObject.java
index ce52169..e0d3f35 100644
--- a/src/org/armedbear/lisp/LispObject.java
+++ b/src/org/armedbear/lisp/LispObject.java
@@ -658,7 +658,7 @@ public class LispObject //extends Lisp
           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) {
@@ -672,6 +672,9 @@ public class LispObject //extends Lisp
                     return doc;
                 }
             }
+        } else if (fn instanceof StandardGenericFunction) {
+            return StandardGenericFunction.checkStandardGenericFunction(fn)
+                .slots[StandardGenericFunctionClass.SLOT_INDEX_DOCUMENTATION];
         }
     }
     return NIL;





More information about the armedbear-devel mailing list