Next: build-declarations, Previous: analyze-declaration-specifier, Up: API
⇒ result-specifier
The generic function build-declaration-specifier is used by build-declarations to reconstruct a declaration specifier from the parts returned by analyze-declaration-specifier.
It is hence the counterpart of analyze-declaration-specifier: whereas that one disassembles a declaration specifier into parts, build-declaration-specifier assembles the parts back into a declaration specifier.
PARSE-DECLARATIONS> (build-declaration-specifier 'optimize nil '((speed 0) debug)) => (OPTIMIZE (SPEED 0) DEBUG) PARSE-DECLARATIONS> (build-declaration-specifier 'type '(x y z) 'fixnum) => (TYPE FIXNUM X Y Z) PARSE-DECLARATIONS> (build-declaration-specifier 'inline '(#'f #'g #'h) nil) => (INLINE F G H)
None.
analyze-declaration-specifier
build-declarations
build-declaration-specifier can be thought of as being (almost) the inverse function of
analyze-declaration-specifier. That is for an arbitrary declaration specifier in
*SPEC*
, the following code should axiomatically result in a declaration specifier that is
equivalent to *SPEC*
when interpreted by the Common Lisp implementation:
(multiple-value-call #'build-declaration-specifier (analyze-declaration-specifier (first *spec*) (rest *spec*) nil))
However, the result may in fact not be EQUAL
to the original
specifier, as analyze-declaration-specifier can perform arbitrary normalization:
PARSE-DECLARATIONS> (let ((spec '((string 512) variable))) (multiple-value-call #'build-declaration-specifier (analyze-declaration-specifier (first spec) (rest spec) nil))) => (TYPE (STRING 512) VARIABLE)