comparison lispref/eval.texi @ 68761:35eb90d9d028

(Function Indirection): Add NOERROR to indirect-function.
author Kim F. Storm <storm@cua.dk>
date Fri, 10 Feb 2006 00:09:18 +0000
parents 067115a6e738
children 1caee6e0cbe1 4b3d39451150
comparison
equal deleted inserted replaced
68760:1d4bcec8c4c4 68761:35eb90d9d028
312 312
313 The built-in function @code{indirect-function} provides an easy way to 313 The built-in function @code{indirect-function} provides an easy way to
314 perform symbol function indirection explicitly. 314 perform symbol function indirection explicitly.
315 315
316 @c Emacs 19 feature 316 @c Emacs 19 feature
317 @defun indirect-function function 317 @defun indirect-function function &optional noerror
318 @anchor{Definition of indirect-function} 318 @anchor{Definition of indirect-function}
319 This function returns the meaning of @var{function} as a function. If 319 This function returns the meaning of @var{function} as a function. If
320 @var{function} is a symbol, then it finds @var{function}'s function 320 @var{function} is a symbol, then it finds @var{function}'s function
321 definition and starts over with that value. If @var{function} is not a 321 definition and starts over with that value. If @var{function} is not a
322 symbol, then it returns @var{function} itself. 322 symbol, then it returns @var{function} itself.
323 323
324 This function signals a @code{void-function} error if the final 324 This function signals a @code{void-function} error if the final symbol
325 symbol is unbound and a @code{cyclic-function-indirection} error if 325 is unbound and optional argument @var{noerror} is @code{nil} or
326 there is a loop in the chain of symbols. 326 omitted. Otherwise, if @var{noerror} is non-@code{nil}, it returns
327 @code{nil} if the final symbol is unbound.
328
329 It signals a @code{cyclic-function-indirection} error if there is a
330 loop in the chain of symbols.
327 331
328 Here is how you could define @code{indirect-function} in Lisp: 332 Here is how you could define @code{indirect-function} in Lisp:
329 333
330 @smallexample 334 @smallexample
331 (defun indirect-function (function) 335 (defun indirect-function (function)