FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Unrevised from 8.2 to 9.0.
8.2 version

function-name-p

Arguments: spec

This function returns true if spec is a suitable function name (whether or not it actually names an operator) and returns nil otherwise. function-name-p thus returns true when spec is a symbol and when spec is a list of the form (setf symbol). According to the ANS, symbols and lists of that type are the only valid function names.

Allegro CL, however, permits additional lists, defined with def-function-spec-handler, to name functions. If spec is a proper (Allegro CL) function spec, that is one whose fspec-first is a proper function spec name (one defined by def-function-spec-handler) and for which a :validate call returns true, function-name-p returns true.

function-name-p has been added because the behavior of the Common Lisp function fboundp has been brought into conformance (with the exception noted). In earlier releases of Allegro CL, fboundp would return nil when given an argument which was not a valid function name. Thus, for example, (fboundp 2) returned nil. However, the ANS requires that fboundp signal an error if passed an argument which is not a valid function name, and return nil only for valid function names which do not, in fact, name an operator. This function allows you to modify potentially improper calls to fboundp to avoid errors in 7.0 which would not have been signaled in earlier releases. A call to fboundp can be modified as follows:

(if (function-name-p spec) (fboundp spec))
;; will behave in Allegro CL 7.0 just as
(fboundp spec)
;; did in earlier releases.

The ANS seems to forbid function names other than symbols and lists of the form (setf symbol). Allegro CL allows additional lists, specified by def-function-spec-handler. fboundp does not signal an error when passed a valid Allegro CL function spec, even if it is not an ANS function spec (and thus fboundp is arguably non-conformant).


Copyright (c) 1998-2012, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 9.0. This page was not revised from the 8.2 page.
Created 2012.5.30.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Unrevised from 8.2 to 9.0.
8.2 version