Next: , Previous: declaration-env-p, Up: API


declaration-env.affected-variables

Syntax

— Function: declaration-env.affected-variables declaration-env &optional allowed-decl-ids ⇒ binding-names

Arguments and Values

declaration-env
A declaration-env
allowed-decl-ids
A list of normalized declaration identifiers.
binding-names
A list of normalized binding names.

Description

The function declaration-env.affected-variables returns all binding names that are affected by the declaration specifiers stored in declaration-env. If allowed-decl-ids is given, only the binding names affected by the specifiers starting with one of allowed-decl-ids are returned.

Examples

  PARSE-DECLARATIONS> (defparameter *env* (parse-declarations '((declare (optimize speed))
                                                                (declare (fixnum x y))
                                                                (declare (inline +)))))
  => *ENV*
  PARSE-DECLARATIONS> (declaration-env.affected-variables *env*)
  => (X Y #'+)
  PARSE-DECLARATIONS> (declaration-env.affected-variables *env* '(type))
  => (X Y)
  
  ;;; The following returns NIL, as (ANALYZE-DECLARATION-SPECIFIER 'FIXNUM NIL NIL)
  ;;; returns TYPE as first value.
  PARSE-DECLARATIONS> (declaration-env.affected-variables *env* '(fixnum))
  => NIL
  

Exceptional Situations

Signals an error of type TYPE-ERROR if declaration-env is not a declaration-env.

See Also

analyze-declaration-specifier
declaration-env
declaration-env.policy