Changeset 12030


Ignore:
Timestamp:
07/04/09 21:27:12 (14 years ago)
Author:
ehuelsmann
Message:

Add documentation on different symbol value lookup functions.

Location:
trunk/abcl/src/org/armedbear/lisp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/LispThread.java

    r12027 r12030  
    333333    }
    334334
     335    /** Looks up the value of a special binding in the context of the
     336     * given thread.
     337     *
     338     * In order to find the value of a special variable (in general),
     339     * use {@link Symbol#symbolValue}.
     340     *
     341     * @param name The name of the special variable, normally a symbol
     342     * @return The inner most binding of the special, or null if unbound
     343     *
     344     * @see Symbol#symbolValue
     345     */
    335346    public final LispObject lookupSpecial(LispObject name)
    336347    {
  • trunk/abcl/src/org/armedbear/lisp/Symbol.java

    r12028 r12030  
    284284  }
    285285
    286   // Raw accessor.
     286  /** Gets the value associated with the symbol
     287   * as set by SYMBOL-VALUE.
     288   *
     289   * @return The associated value, or null if unbound.
     290   *
     291   * @see Symbol#symbolValue
     292   */
    287293  @Override
    288294  public LispObject getSymbolValue()
     
    291297  }
    292298
     299  /** Sets the value associated with the symbol
     300   * as if set by SYMBOL-VALUE.
     301   *
     302   * @return The associated value, or null if unbound.
     303   *
     304   * @see Symbol#symbolValue
     305   */
    293306  public final void setSymbolValue(LispObject value)
    294307  {
     
    296309  }
    297310
     311  /** Returns the value associated with this symbol in the current
     312   * thread context when it is treated as a special variable.
     313   *
     314   * A lisp error is thrown if the symbol is unbound.
     315   *
     316   * @return The associated value
     317   * @throws org.armedbear.lisp.ConditionThrowable
     318   *
     319   * @see LispThread#lookupSpecial
     320   * @see Symbol#getSymbolValue()
     321   *
     322   */
    298323  public final LispObject symbolValue() throws ConditionThrowable
    299324  {
    300     LispObject val = LispThread.currentThread().lookupSpecial(this);
    301     if (val != null)
    302       return val;
    303     if (value != null)
    304       return value;
    305     return error(new UnboundVariable(this));
    306   }
    307 
     325    return symbolValue(LispThread.currentThread());
     326  }
     327
     328  /** Returns the value associated with this symbol in the specified
     329   * thread context when it is treated as a special variable.
     330   *
     331   * A lisp error is thrown if the symbol is unbound.
     332   *
     333   * @return The associated value
     334   * @throws org.armedbear.lisp.ConditionThrowable
     335   *
     336   * @see LispThread#lookupSpecial
     337   * @see Symbol#getSymbolValue()
     338   *
     339   */
    308340  public final LispObject symbolValue(LispThread thread) throws ConditionThrowable
    309341  {
     
    316348  }
    317349
     350  /** Returns the value of the symbol in the current thread context;
     351   * if the symbol has been declared special, the value of the innermost
     352   * binding is returned. Otherwise, the SYMBOL-VALUE is returned, or
     353   * null if unbound.
     354   *
     355   * @return A lisp object, or null if unbound
     356   *
     357   * @see LispThread#lookupSpecial
     358   * @see Symbol#getSymbolValue()
     359   *
     360   */
    318361  public final LispObject symbolValueNoThrow()
    319362  {
    320     if ((flags & FLAG_SPECIAL) != 0)
    321       {
    322         LispObject val = LispThread.currentThread().lookupSpecial(this);
    323         if (val != null)
    324           return val;
    325       }
    326     return value;
    327   }
    328 
     363    return symbolValueNoThrow(LispThread.currentThread());
     364  }
     365
     366  /** Returns the value of the symbol in the current thread context;
     367   * if the symbol has been declared special, the value of the innermost
     368   * binding is returned. Otherwise, the SYMBOL-VALUE is returned, or
     369   * null if unbound.
     370   *
     371   * @return A lisp object, or null if unbound
     372   *
     373   * @see LispThread#lookupSpecial
     374   * @see Symbol#getSymbolValue()
     375   *
     376   */
    329377  public final LispObject symbolValueNoThrow(LispThread thread)
    330378  {
Note: See TracChangeset for help on using the changeset viewer.