[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Finding out if a variable is proclaimed special



I am wondering how (in MCL, not necessarily portably) to determine if
a variable is proclaimed special.

Background:  As part of our application, we construct and compile
lambda functions.  Sometimes the code we generate does not use all of
the variables in the lambda list.  When not all variables are
accessed, we want to include and appropriate (declare (ignore ...))
statement.  The problem is that MCL's internal code for saving the
special bindings is considered by the compiler to access a variable,
so if we declare it to be ignored, then a warning message is
generated.  We would like to spare our users these messages.

Example:

(defvar c 3)
(compile nil
	 '(lambda (a b c)
	    (declare (ignore b c))
	      (* a a)))
;Compiler warnings:
;   Variable C not ignored, in an anonymous lambda form.

I would like to be able to detect when a variable is proclaimed
special and thus avoid this compiler warning.

  - Tom

Thomas A. Russ                                             tar@isi.edu    
USC/ISI, 4676 Admiralty Way, Marina del Rey, CA 90292      (310) 822-1511