Changeset 12826


Ignore:
Timestamp:
07/25/10 19:09:13 (10 years ago)
Author:
vvoutilainen
Message:

DocString? annotation support, for generating DOCUMENTATION, and
later Javadoc from the same data. Also includes TAGS support
for the DocString? annotations. Patch by Matt Seddon.

Location:
trunk/abcl
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/build.xml

    r12808 r12826  
    450450        <arg value="--append"/>
    451451  <arg value="--regex=|[ \t]+//[ \t]+###[ \t]+\([^ \t]+\)|\1|"/>
     452  <arg value='--regex=|[ \t]*@DocString([ \t]*name=\"\([^\"]*\)|\1|'/>
    452453  <fileset dir="${src.dir}">
    453454    <patternset refid="abcl.source.java"/>
  • trunk/abcl/src/org/armedbear/lisp/ForwardReferencedClass.java

    r12481 r12826  
    7777    }
    7878
    79     // ### make-forward-referenced-class
     79    @DocString(name="make-forward-referenced=class")
    8080    private static final Primitive MAKE_FORWARD_REFERENCED_CLASS =
    8181        new Primitive("make-forward-referenced-class", PACKAGE_SYS, true)
  • trunk/abcl/src/org/armedbear/lisp/Function.java

    r12771 r12826  
    5454    public Function(String name)
    5555    {
    56   this();
     56        this(name, (String)null);
     57    }
     58
     59    public Function(String name, String arglist)
     60    {
     61  this();
     62        if(arglist != null)
     63            setLambdaList(new SimpleString(arglist));
    5764        if (name != null) {
    5865            Symbol symbol = Symbol.addFunction(name.toUpperCase(), this);
     
    6370    }
    6471
     72    public Function(Symbol symbol)
     73    {
     74  this(symbol, null, null);
     75    }
     76
    6577    public Function(Symbol symbol, String arglist)
     78    {
     79  this(symbol, arglist, null);
     80    }
     81
     82    public Function(Symbol symbol, String arglist, String docstring)
    6683    {
    6784  this();
     
    7087            symbol.setBuiltInFunction(true);
    7188        setLambdaName(symbol);
    72         setLambdaList(new SimpleString(arglist));
    73     }
    74 
    75     public Function(Symbol symbol, String arglist, String docstring)
    76     {
    77   this();
    78         symbol.setSymbolFunction(this);
    79         if (cold)
    80             symbol.setBuiltInFunction(true);
    81         setLambdaName(symbol);
    82         setLambdaList(new SimpleString(arglist));
    83         if (docstring != null) {
     89        if(arglist != null)
     90            setLambdaList(new SimpleString(arglist));
     91        if (docstring != null)
    8492            symbol.setDocumentation(Symbol.FUNCTION,
    8593                                    new SimpleString(docstring));
    86         }
    87     }
    88 
    89     public Function(String name, String arglist)
    90     {
    91         this(name);
    92         setLambdaList(new SimpleString(arglist));
    9394    }
    9495
  • trunk/abcl/src/org/armedbear/lisp/Java.java

    r12814 r12826  
    6161
    6262    private static final Primitive ENSURE_JAVA_OBJECT = new pf_ensure_java_object();
     63    @DocString(name="ensure-java-object", args="obj",
     64    doc="Ensures OBJ is wrapped in a JAVA-OBJECT, wrapping it if necessary.")
    6365    private static final class pf_ensure_java_object extends Primitive
    6466    {
    6567        pf_ensure_java_object()
    6668        {
    67             super("ensure-java-object", PACKAGE_JAVA, true, "obj");
     69            super("ensure-java-object", PACKAGE_JAVA, true);
    6870        }
    6971
     
    7476    };
    7577
    76     // ### register-java-exception exception-name condition-symbol => T
    7778    private static final Primitive REGISTER_JAVA_EXCEPTION = new pf_register_java_exception();
     79    @DocString(name="register-java-exception", // => T
     80    args="exception-name condition-symbol",
     81    doc="Registers the Java Throwable named by the symbol EXCEPTION-NAME as the condition " +
     82        "designated by CONDITION-SYMBOL.  Returns T if successful, NIL if not.")
    7883    private static final class pf_register_java_exception extends Primitive
    7984    {
    8085        pf_register_java_exception()
    8186        {
    82             super("register-java-exception", PACKAGE_JAVA, true,
    83                   "exception-name condition-symbol");
     87            super("register-java-exception", PACKAGE_JAVA, true);
    8488        }
    8589
     
    99103    };
    100104
    101     // ### unregister-java-exception exception-name => T or NIL
    102105    private static final Primitive UNREGISTER_JAVA_EXCEPTION = new pf_unregister_java_exception();
     106    @DocString(name="unregister-java-exception", args="exception-name",
     107    doc="Unregisters the Java Throwable EXCEPTION-NAME previously registered" +
     108        " by REGISTER-JAVA-EXCEPTION.")
    103109    private static final class pf_unregister_java_exception extends Primitive
    104110    {
    105111        pf_unregister_java_exception()
    106112        {
    107             super("unregister-java-exception", PACKAGE_JAVA, true,
    108                   "exception-name");
     113            super("unregister-java-exception", PACKAGE_JAVA, true);
    109114        }
    110115
     
    130135    }
    131136
    132     // ### jclass name-or-class-ref &optional class-loader => class-ref
    133137    private static final Primitive JCLASS = new pf_jclass();
     138    @DocString(name="jclass", args="name-or-class-ref &optional class-loader",
     139    doc="Returns a reference to the Java class designated by" +
     140        " NAME-OR-CLASS-REF. If the CLASS-LOADER parameter is passed, the" +
     141        " class is resolved with respect to the given ClassLoader.")
    134142    private static final class pf_jclass extends Primitive
    135143    {
     
    137145        pf_jclass()
    138146        {
    139             super(Symbol.JCLASS, "name-or-class-ref &optional class-loader",
    140                   "Returns a reference to the Java class designated by NAME-OR-CLASS-REF. If the CLASS-LOADER parameter is passed, the class is resolved with respect to the given ClassLoader.");
     147            super(Symbol.JCLASS);
    141148        }
    142149
     
    154161        }
    155162    };
    156 
    157     // ### jfield - retrieve or modify a field in a Java class or instance.
    158     //
    159     // Supported argument patterns:
    160     //
    161     //   Case 1: class-ref  field-name:
    162     //               to retrieve the value of a static field.
    163     //
    164     //   Case 2: class-ref  field-name  instance-ref:
    165     //               to retrieve the value of a class field of the instance.
    166     //
    167     //   Case 3: class-ref  field-name  primitive-value:
    168     //               to store primitive-value in a static field.
    169     //
    170     //   Case 4: class-ref  field-name  instance-ref  value:
    171     //               to store value in a class field of the instance.
    172     //
    173     //   Case 5: class-ref  field-name  nil  value:
    174     //               to store value in a static field (when value may be
    175     //               confused with an instance-ref).
    176     //
    177     //   Case 6: field-name  instance:
    178     //               to retrieve the value of a field of the instance. The
    179     //               class is derived from the instance.
    180     //
    181     //   Case 7: field-name  instance  value:
    182     //               to store value in a field of the instance. The class is
    183     //               derived from the instance.
    184     //
    185163
    186164    static final LispObject jfield(Primitive fun, LispObject[] args, boolean translate)
     
    259237    }
    260238
    261     // ### jfield class-ref-or-field field-or-instance &optional instance value
     239
    262240    private static final Primitive JFIELD = new pf_jfield();
     241    @DocString(name="jfield",
     242    args="class-ref-or-field field-or-instance &optional instance value",
     243    doc="Retrieves or modifies a field in a Java class or instance.\n\n"+
     244        "Supported argument patterns:\n\n"+
     245        "   Case 1: class-ref  field-name:\n"+
     246        "      Retrieves the value of a static field.\n\n"+
     247        "   Case 2: class-ref  field-name  instance-ref:\n"+
     248        "      Retrieves the value of a class field of the instance.\n\n"+
     249        "   Case 3: class-ref  field-name  primitive-value:\n"+
     250        "      Stores a primitive-value in a static field.\n\n"+
     251        "   Case 4: class-ref  field-name  instance-ref  value:\n"+
     252        "      Stores value in a class field of the instance.\n\n"+
     253        "   Case 5: class-ref  field-name  nil  value:\n"+
     254        "      Stores value in a static field (when value may be\n"+
     255        "      confused with an instance-ref).\n\n"+
     256        "   Case 6: field-name  instance:\n"+
     257        "      Retrieves the value of a field of the instance. The\n"+
     258        "      class is derived from the instance.\n\n"+
     259        "   Case 7: field-name  instance  value:\n"+
     260        "      Stores value in a field of the instance. The class is\n"+
     261        "      derived from the instance.\n\n"
     262        )
    263263    private static final class pf_jfield extends Primitive
    264264    {
    265265        pf_jfield()
    266266        {
    267             super("jfield", PACKAGE_JAVA, true,
    268                   "class-ref-or-field field-or-instance &optional instance value");
     267            super("jfield", PACKAGE_JAVA, true);
    269268        }
    270269
     
    276275    };
    277276
    278     // ### jfield-raw - retrieve or modify a field in a Java class or instance.
    279277    private static final Primitive JFIELD_RAW = new pf_jfield_raw();
     278    @DocString(name="jfield",
     279    args="class-ref-or-field field-or-instance &optional instance value",
     280    doc="Retrieves or modifies a field in a Java class or instance. Does not\n"+
     281        "attempt to coerce its value or the result into a Lisp object.\n\n"+
     282        "Supported argument patterns:\n\n"+
     283        "   Case 1: class-ref  field-name:\n"+
     284        "      Retrieves the value of a static field.\n\n"+
     285        "   Case 2: class-ref  field-name  instance-ref:\n"+
     286        "      Retrieves the value of a class field of the instance.\n\n"+
     287        "   Case 3: class-ref  field-name  primitive-value:\n"+
     288        "      Stores a primitive-value in a static field.\n\n"+
     289        "   Case 4: class-ref  field-name  instance-ref  value:\n"+
     290        "      Stores value in a class field of the instance.\n\n"+
     291        "   Case 5: class-ref  field-name  nil  value:\n"+
     292        "      Stores value in a static field (when value may be\n"+
     293        "      confused with an instance-ref).\n\n"+
     294        "   Case 6: field-name  instance:\n"+
     295        "      Retrieves the value of a field of the instance. The\n"+
     296        "      class is derived from the instance.\n\n"+
     297        "   Case 7: field-name  instance  value:\n"+
     298        "      Stores value in a field of the instance. The class is\n"+
     299        "      derived from the instance.\n\n"
     300        )
    280301    private static final class pf_jfield_raw extends Primitive
    281302    {
    282303        pf_jfield_raw()
    283304        {
    284             super("jfield-raw", PACKAGE_JAVA, true,
    285                   "class-ref-or-field field-or-instance &optional instance value");
     305            super("jfield-raw", PACKAGE_JAVA, true);
    286306        }
    287307
     
    293313    };
    294314
    295     // ### jconstructor class-ref &rest parameter-class-refs
    296315    private static final Primitive JCONSTRUCTOR = new pf_jconstructor();
     316    @DocString(name="jconstructor", args="class-ref &rest parameter-class-refs",
     317    doc="Returns a reference to the Java constructor of CLASS-REF with the" +
     318        " given PARAMETER-CLASS-REFS.")
    297319    private static final class pf_jconstructor extends Primitive
    298320    {
    299321        pf_jconstructor()
    300322        {
    301             super("jconstructor", PACKAGE_JAVA, true,
    302                   "class-ref &rest parameter-class-refs");
     323            super("jconstructor", PACKAGE_JAVA, true);
    303324        }
    304325
     
    343364    };
    344365
    345     // ### jmethod class-ref name &rest parameter-class-refs
    346366    private static final Primitive JMETHOD = new pf_jmethod();
     367
     368    @DocString(name="jmethod", args="class-ref method-name &rest parameter-class-refs",
     369    doc="Returns a reference to the Java method METHOD-NAME of CLASS-REF with the" +
     370        " given PARAMETER-CLASS-REFS.")
    347371    private static final class pf_jmethod extends Primitive
    348372    {
    349373        pf_jmethod()
    350374        {
    351             super("jmethod", PACKAGE_JAVA, true,
    352                   "class-ref name &rest parameter-class-refs");
     375            super("jmethod", PACKAGE_JAVA, true);
    353376        }
    354377
     
    471494    }
    472495
    473     // ### jstatic method class &rest args
    474496    private static final Primitive JSTATIC = new pf_jstatic();
     497    @DocString(name="jstatic", args="method class &rest args",
     498    doc="Invokes the static method METHOD on class CLASS with ARGS.")
    475499    private static final class pf_jstatic extends Primitive
    476500    {
    477501        pf_jstatic()
    478502        {
    479             super("jstatic", PACKAGE_JAVA, true, "method class &rest args");
     503            super("jstatic", PACKAGE_JAVA, true);
    480504        }
    481505
     
    487511    };
    488512
    489     // ### jstatic-raw method class &rest args
    490513    private static final Primitive JSTATIC_RAW = new pf_jstatic_raw();
     514    @DocString(name="jstatic-raw", args="method class &rest args",
     515    doc="Invokes the static method METHOD on class CLASS with ARGS. Does not "+
     516        "attempt to coerce the arguments or result into a Lisp object.")
    491517    private static final class pf_jstatic_raw extends Primitive
    492518    {
    493519        pf_jstatic_raw()
    494520        {
    495             super("jstatic-raw", PACKAGE_JAVA, true,
    496                   "method class &rest args");
     521            super("jstatic-raw", PACKAGE_JAVA, true);
    497522        }
    498523
     
    504529    };
    505530
    506     // ### jnew constructor &rest args
    507531    private static final Primitive JNEW = new pf_jnew();
     532    @DocString(name="jnew", args="constructor &rest args",
     533    doc="Invokes the Java constructor CONSTRUCTOR with the arguments ARGS.")
    508534    private static final class pf_jnew extends Primitive
    509535    {
    510536        pf_jnew()
    511537        {
    512             super("jnew", PACKAGE_JAVA, true, "constructor &rest args");
     538            super("jnew", PACKAGE_JAVA, true);
    513539        }
    514540
     
    567593    };
    568594
    569     // ### jnew-array element-type &rest dimensions
    570595    private static final Primitive JNEW_ARRAY = new pf_jnew_array();
     596    @DocString(name="jnew-array", args="element-type &rest dimensions",
     597    doc="Creates a new Java array of type ELEMENT-TYPE, with the given" +
     598        " DIMENSIONS.")
    571599    private static final class pf_jnew_array extends Primitive
    572600    {
    573601        pf_jnew_array()
    574602        {
    575             super("jnew-array", PACKAGE_JAVA, true,
    576                   "element-type &rest dimensions");
     603            super("jnew-array", PACKAGE_JAVA, true);
    577604        }
    578605
     
    625652    }
    626653
    627     // ### jarray-ref java-array &rest indices
    628654    private static final Primitive JARRAY_REF = new pf_jarray_ref();
     655    @DocString(name="jarray-ref", args="java-array &rest indices",
     656    doc="Dereferences the Java array JAVA-ARRAY using the given INDICIES, " +
     657        "coercing the result into a Lisp object, if possible.")
    629658    private static final class pf_jarray_ref extends Primitive
    630659    {
    631660        pf_jarray_ref()
    632661        {
    633             super("jarray-ref", PACKAGE_JAVA, true,
    634                   "java-array &rest indices");
     662            super("jarray-ref", PACKAGE_JAVA, true);
    635663        }
    636664
     
    642670    };
    643671
    644     // ### jarray-ref-raw java-array &rest indices
    645672    private static final Primitive JARRAY_REF_RAW = new pf_jarray_ref_raw();
     673    @DocString(name="jarray-ref-raw", args="java-array &rest indices",
     674    doc="Dereference the Java array JAVA-ARRAY using the given INDICIES. " +
     675        "Does not attempt to coerce the result into a Lisp object.")
    646676    private static final class pf_jarray_ref_raw extends Primitive
    647677    {
    648678        pf_jarray_ref_raw()
    649679        {
    650             super("jarray-ref-raw", PACKAGE_JAVA, true,
    651                   "java-array &rest indices");
     680            super("jarray-ref-raw", PACKAGE_JAVA, true);
    652681        }
    653682
     
    659688    };
    660689
    661     // ### jarray-set java-array new-value &rest indices
    662690    private static final Primitive JARRAY_SET = new pf_jarray_set();
     691    @DocString(name="jarray-set", args="java-array new-value &rest indices",
     692    doc="Stores NEW-VALUE at the given index in JAVA-ARRAY.")
    663693    private static final class pf_jarray_set extends Primitive
    664694    {
    665695        pf_jarray_set()
    666696        {
    667             super("jarray-set", PACKAGE_JAVA, true,
    668                   "java-array new-value &rest indices");
     697            super("jarray-set", PACKAGE_JAVA, true);
    669698        }
    670699
     
    699728    };
    700729
    701     // ### jcall method instance &rest args
    702730    /**  Calls makeLispObject() to convert the result to an appropriate Lisp type. */
    703731    private static final Primitive JCALL = new pf_jcall();
     732    @DocString(name="jcall", args="method-ref instance &rest args",
     733    doc="Invokes the Java method METHOD-REF on INSTANCE with arguments ARGS," +
     734        " coercing the result into a Lisp object, if possible.")
    704735    private static final class pf_jcall extends Primitive
    705736    {
    706737        pf_jcall()
    707738        {
    708             super(Symbol.JCALL, "method-ref instance &rest args");
     739            super(Symbol.JCALL);
    709740        }
    710741
     
    716747    };
    717748
    718     // ### jcall-raw method instance &rest args
    719749    /**
    720750     * Does no type conversion. The result of the call is simply wrapped in a
     
    722752     */
    723753    private static final Primitive JCALL_RAW = new pf_jcall_raw();
     754    @DocString(name="jcall-raw", args="method-ref instance &rest args",
     755    doc="Invokes the Java method METHOD-REF on INSTANCE with arguments ARGS." +
     756        " Does not attempt to coerce the result into a Lisp object.")
    724757    private static final class pf_jcall_raw extends Primitive
    725758    {
    726759        pf_jcall_raw()
    727760        {
    728             super(Symbol.JCALL_RAW, "method-ref instance &rest args");
     761            super(Symbol.JCALL_RAW);
    729762        }
    730763
     
    9841017    }
    9851018
    986     // ### make-immediate-object object &optional type
    9871019    private static final Primitive MAKE_IMMEDIATE_OBJECT = new pf_make_immediate_object();
     1020    @DocString(name="make-immediate-object", args="object &optional type",
     1021    doc="Attempts to coerce a given Lisp object into a java-object of the\n"+
     1022        "given type.  If type is not provided, works as jobject-lisp-value.\n"+
     1023        "Currently, type may be :BOOLEAN, treating the object as a truth value,\n"+
     1024        "or :REF, which returns Java null if NIL is provided.")
    9881025    private static final class pf_make_immediate_object extends Primitive
    9891026    {
    9901027        pf_make_immediate_object()
    9911028        {
    992             super("make-immediate-object", PACKAGE_JAVA, true,
    993                   "object &optional type");
     1029            super("make-immediate-object", PACKAGE_JAVA, true);
    9941030        }
    9951031
     
    10201056    };
    10211057
    1022     // ### java-object-p
    10231058    private static final Primitive JAVA_OBJECT_P = new pf_java_object_p();
     1059    @DocString(name="java-object-p", args="object",
     1060    doc="Returns T if OBJECT is a JAVA-OBJECT.")
    10241061    private static final class pf_java_object_p extends Primitive
    10251062    {
    10261063        pf_java_object_p()
    10271064        {
    1028             super("java-object-p", PACKAGE_JAVA, true, "object");
     1065            super("java-object-p", PACKAGE_JAVA, true);
    10291066        }
    10301067
     
    10361073    };
    10371074
    1038     // ### jobject-lisp-value java-object
    10391075    private static final Primitive JOBJECT_LISP_VALUE = new pf_jobject_lisp_value();
     1076    @DocString(name="jobject-lisp-value", args="java-object",
     1077    doc="Attempts to coerce JAVA-OBJECT into a Lisp object.")
    10401078    private static final class pf_jobject_lisp_value extends Primitive
    10411079    {
     
    10521090    };
    10531091
    1054     // ### jcoerce java-object intended-class
    10551092    private static final Primitive JCOERCE = new pf_jcoerce();
     1093    @DocString(name="jcoerce", args="object intended-class",
     1094    doc="Attempts to coerce OBJECT into a JavaObject of class INTENDED-CLASS." +
     1095        "  Raises a TYPE-ERROR if no conversion is possible.")
    10561096    private static final class pf_jcoerce extends Primitive
    10571097    {
    10581098        pf_jcoerce()
    10591099        {
    1060             super("jcoerce", PACKAGE_JAVA, true, "java-object intended-class");
     1100            super("jcoerce", PACKAGE_JAVA, true);
    10611101        }
    10621102
     
    10741114    };
    10751115
    1076     // ### %jget-property-value java-object property-name
    10771116    private static final Primitive JGET_PROPERTY_VALUE = new pf__jget_property_value();
     1117    @DocString(name="%jget-propety-value", args="java-object property-name",
     1118    doc="Gets a JavaBeans property on JAVA-OBJECT.\n" +
     1119        "SYSTEM-INTERNAL: Use jproperty-value instead.")
    10781120    private static final class pf__jget_property_value extends Primitive
    10791121    {
     
    11031145    };
    11041146   
    1105     // ### %jset-property-value java-object property-name value
    11061147    private static final Primitive JSET_PROPERTY_VALUE = new pf__jset_property_value();
     1148    @DocString(name="%jset-propety-value", args="java-object property-name value",
     1149    doc="Sets a JavaBean property on JAVA-OBJECT.\n" +
     1150        "SYSTEM-INTERNAL: Use (setf jproperty-value) instead.")
    11071151    private static final class pf__jset_property_value extends Primitive
    11081152    {
     
    11391183    };
    11401184
    1141 
    1142     // ### jrun-exception-protected closure
    11431185    private static final Primitive JRUN_EXCEPTION_PROTECTED = new pf_jrun_exception_protection();
     1186    @DocString(name="jrun-exception-protected", args="closure",
     1187    doc="Invokes the function CLOSURE and returns the result.  "+
     1188        "Signals an error if stack or heap exhaustion occurs.")
    11441189    private static final class pf_jrun_exception_protection extends Primitive
    11451190    {
    11461191        pf_jrun_exception_protection()
    11471192        {
    1148             super("jrun-exception-protected", PACKAGE_JAVA, true,
    1149                   "closure");
     1193            super("jrun-exception-protected", PACKAGE_JAVA, true);
    11501194        }
    11511195
  • trunk/abcl/src/org/armedbear/lisp/Lisp.java

    r12749 r12826  
    9090
    9191
    92   // ### nil
     92  @DocString(name="nil")
    9393  public static final LispObject NIL = Nil.NIL;
    9494
     
    262262  }
    263263
    264   // ### interactive-eval
     264  @DocString(name="interactive-eval")
    265265  private static final Primitive INTERACTIVE_EVAL =
    266266    new Primitive("interactive-eval", PACKAGE_SYS, true)
  • trunk/abcl/src/org/armedbear/lisp/LispObject.java

    r12637 r12826  
    658658          return ((Cons)entry).cdr;
    659659      }
     660    if(docType == Symbol.FUNCTION && this instanceof Symbol) {
     661        Object fn = ((Symbol)this).getSymbolFunction();
     662        if(fn instanceof Function) {
     663            DocString ds = fn.getClass().getAnnotation(DocString.class);
     664            if(ds != null) {
     665                String arglist = ds.args();
     666                String docstring = ds.doc();
     667                if(arglist.length() != 0)
     668                    ((Function)fn).setLambdaList(new SimpleString(arglist));
     669                if(docstring.length() != 0) {
     670                    SimpleString doc = new SimpleString(docstring);
     671                    ((Symbol)this).setDocumentation(Symbol.FUNCTION, doc);
     672                    return doc;
     673                }
     674            }
     675        }
     676    }
    660677    return NIL;
    661678  }
  • trunk/abcl/src/org/armedbear/lisp/LispThread.java

    r12819 r12826  
    861861    }
    862862
    863     // ### make-thread
     863    @DocString(name="make-thread", args="function &optional &key name")
    864864    private static final Primitive MAKE_THREAD =
    865865        new Primitive("make-thread", PACKAGE_THREADS, true, "function &optional &key name")
     
    887887    };
    888888
    889     // ### threadp
     889    @DocString(name="threadp", args="object",
     890    doc="Boolean predicate testing if OBJECT is a thread.")
    890891    private static final Primitive THREADP =
    891         new Primitive("threadp", PACKAGE_THREADS, true, "object",
    892           "Boolean predicate as whether OBJECT is a thread.")
     892        new Primitive("threadp", PACKAGE_THREADS, true)
    893893    {
    894894        @Override
     
    899899    };
    900900
    901     // ### thread-alive-p
     901    @DocString(name="thread-alive-p", args="thread",
     902    doc="Returns T if THREAD is alive.")
    902903    private static final Primitive THREAD_ALIVE_P =
    903904        new Primitive("thread-alive-p", PACKAGE_THREADS, true, "thread",
     
    918919    };
    919920
    920     // ### thread-name
     921    @DocString(name="thread-name", args="thread",
     922    doc="Return the name of THREAD, if it has one.")
    921923    private static final Primitive THREAD_NAME =
    922         new Primitive("thread-name", PACKAGE_THREADS, true, "thread",
    923           "Return the name of THREAD if it has one.")
     924        new Primitive("thread-name", PACKAGE_THREADS, true)
    924925    {
    925926        @Override
     
    973974    }
    974975
    975     // ### sleep
    976     private static final Primitive SLEEP = new Primitive("sleep", PACKAGE_CL, true, "seconds",
    977                "Causes the invoking thread to sleep for SECONDS seconds.\nSECONDS may be a value between 0 1and 1.")
     976    @DocString(name="sleep", args="seconds",
     977    doc="Causes the invoking thread to sleep for SECONDS seconds.\n"+
     978        "SECONDS may be a value between 0 1and 1.")
     979    private static final Primitive SLEEP = new Primitive("sleep", PACKAGE_CL, true)
    978980    {
    979981        @Override
     
    991993    };
    992994
    993     // ### mapcar-threads
     995    @DocString(name="mapcar-threads", args= "function",
     996    doc="Applies FUNCTION to all existing threads.")
    994997    private static final Primitive MAPCAR_THREADS =
    995         new Primitive("mapcar-threads", PACKAGE_THREADS, true, "function",
    996           "Applies FUNCTION to all existing threads.")
     998        new Primitive("mapcar-threads", PACKAGE_THREADS, true)
    997999    {
    9981000        @Override
     
    10121014    };
    10131015
    1014     // ### destroy-thread
     1016    @DocString(name="destroy-thread", args="thread", doc="Mark THREAD as destroyed")
    10151017    private static final Primitive DESTROY_THREAD =
    1016         new Primitive("destroy-thread", PACKAGE_THREADS, true, "thread",
    1017           "Mark THREAD as destroyed.")
     1018        new Primitive("destroy-thread", PACKAGE_THREADS, true)
    10181019    {
    10191020        @Override
     
    10321033    };
    10331034
    1034     // ### interrupt-thread thread function &rest args => T
    1035     // Interrupts thread and forces it to apply function to args. When the
    1036     // function returns, the thread's original computation continues. If
    1037     // multiple interrupts are queued for a thread, they are all run, but the
    1038     // order is not guaranteed.
     1035    // => T
     1036    @DocString(name="interrupt-thread", args="thread function &rest args",
     1037    doc="Interrupts thread and forces it to apply function to args. When the\n"+
     1038        "function returns, the thread's original computation continues. If\n"+
     1039        "multiple interrupts are queued for a thread, they are all run, but the\n"+
     1040        "order is not guaranteed.")
    10391041    private static final Primitive INTERRUPT_THREAD =
    10401042        new Primitive("interrupt-thread", PACKAGE_THREADS, true,
     
    10631065    };
    10641066
    1065     // ### current-thread
     1067    @DocString(name="current-thread",
     1068    doc="Returns a reference to invoking thread.")
    10661069    private static final Primitive CURRENT_THREAD =
    1067         new Primitive("current-thread", PACKAGE_THREADS, true, "",
    1068           "Returns a reference to invoking thread.")
     1070        new Primitive("current-thread", PACKAGE_THREADS, true)
    10691071    {
    10701072        @Override
     
    10751077    };
    10761078
    1077     // ### backtrace
     1079    @DocString(name="backtrace",
     1080               doc="Returns a backtrace of the invoking thread.")
    10781081    private static final Primitive BACKTRACE =
    1079         new Primitive("backtrace", PACKAGE_SYS, true, "",
    1080           "Returns a backtrace of the invoking thread.")
     1082        new Primitive("backtrace", PACKAGE_SYS, true)
    10811083    {
    10821084        @Override
     
    10901092        }
    10911093    };
    1092     // ### frame-to-string
     1094    @DocString(name="frame-to-string", args="frame")
    10931095    private static final Primitive FRAME_TO_STRING =
    1094         new Primitive("frame-to-string", PACKAGE_SYS, true, "frame")
     1096        new Primitive("frame-to-string", PACKAGE_SYS, true)
    10951097    {
    10961098        @Override
     
    11051107    };
    11061108
    1107     // ### frame-to-list
     1109    @DocString(name="frame-to-list", args="frame")
    11081110    private static final Primitive FRAME_TO_LIST =
    1109         new Primitive("frame-to-list", PACKAGE_SYS, true, "frame")
     1111        new Primitive("frame-to-list", PACKAGE_SYS, true)
    11101112    {
    11111113        @Override
     
    11211123
    11221124
    1123     // ### use-fast-calls
     1125    @DocString(name="use-fast-calls")
    11241126    private static final Primitive USE_FAST_CALLS =
    11251127        new Primitive("use-fast-calls", PACKAGE_SYS, true)
     
    11331135    };
    11341136
    1135     // ### synchronized-on
     1137    @DocString(name="synchronized-on", args="form &body body")
    11361138    private static final SpecialOperator SYNCHRONIZED_ON =
    11371139        new SpecialOperator("synchronized-on", PACKAGE_THREADS, true,
     
    11521154    };
    11531155
    1154     // ### object-wait
     1156    @DocString(name="object-wait", args="object &optional timeout")
    11551157    private static final Primitive OBJECT_WAIT =
    1156         new Primitive("object-wait", PACKAGE_THREADS, true,
    1157                       "object &optional timeout")
     1158        new Primitive("object-wait", PACKAGE_THREADS, true)
    11581159    {
    11591160        @Override
     
    11901191    };
    11911192
    1192     // ### object-notify
     1193    @DocString(name="object-notify", args="object")
    11931194    private static final Primitive OBJECT_NOTIFY =
    11941195        new Primitive("object-notify", PACKAGE_THREADS, true,
     
    12091210    };
    12101211
    1211     // ### object-notify-all
     1212    @DocString(name="object-notify-all", args="object")
    12121213    private static final Primitive OBJECT_NOTIFY_ALL =
    1213         new Primitive("object-notify-all", PACKAGE_THREADS, true,
    1214                       "object")
     1214        new Primitive("object-notify-all", PACKAGE_THREADS, true)
    12151215    {
    12161216        @Override
  • trunk/abcl/src/org/armedbear/lisp/Operator.java

    r12288 r12826  
    5454    public final LispObject getLambdaList()
    5555    {
     56        if(lambdaList == null) {
     57            DocString ds = getClass().getAnnotation(DocString.class);
     58            if(ds != null)
     59                lambdaList = new SimpleString(ds.args());
     60        }
    5661        return lambdaList;
    5762    }
  • trunk/abcl/src/org/armedbear/lisp/Primitive.java

    r12254 r12826  
    4646    }
    4747
     48    public Primitive(Symbol symbol)
     49    {
     50        super(symbol);
     51    }
     52
    4853    public Primitive(Symbol symbol, String arglist)
    4954    {
  • trunk/abcl/src/org/armedbear/lisp/logorc2.java

    r12288 r12826  
    3838import java.math.BigInteger;
    3939
    40 // ### logorc2
    4140// logorc2 integer-1 integer-2 => result-integer
    4241// or integer-1 with complement of integer-2
     42@DocString(name="logorc2", args="integer-1 integer-2")
    4343public final class logorc2 extends Primitive
    4444{
  • trunk/abcl/src/org/armedbear/lisp/package_error_package.java

    r12288 r12826  
    3636import static org.armedbear.lisp.Lisp.*;
    3737
    38 // ### package-error-package
     38@DocString(name="package-error-package")
    3939public final class package_error_package extends Primitive
    4040{
Note: See TracChangeset for help on using the changeset viewer.