Changeset 12030
- Timestamp:
- 07/04/09 21:27:12 (14 years ago)
- Location:
- trunk/abcl/src/org/armedbear/lisp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/src/org/armedbear/lisp/LispThread.java
r12027 r12030 333 333 } 334 334 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 */ 335 346 public final LispObject lookupSpecial(LispObject name) 336 347 { -
trunk/abcl/src/org/armedbear/lisp/Symbol.java
r12028 r12030 284 284 } 285 285 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 */ 287 293 @Override 288 294 public LispObject getSymbolValue() … … 291 297 } 292 298 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 */ 293 306 public final void setSymbolValue(LispObject value) 294 307 { … … 296 309 } 297 310 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 */ 298 323 public final LispObject symbolValue() throws ConditionThrowable 299 324 { 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 */ 308 340 public final LispObject symbolValue(LispThread thread) throws ConditionThrowable 309 341 { … … 316 348 } 317 349 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 */ 318 361 public final LispObject symbolValueNoThrow() 319 362 { 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 */ 329 377 public final LispObject symbolValueNoThrow(LispThread thread) 330 378 {
Note: See TracChangeset
for help on using the changeset viewer.