Comment 2 for bug 736345

Revision history for this message
Jean-Philippe Paradis (hexstream) wrote :

After reading the spec page for IGNORE/IGNORABLE yet again, I'm pretty sure that IGNORE/IGNORABLE were not meant to be bound-only declarations, though it might well be that it's the case in most or all implementations (I haven't checked).

The spec doesn't specify this explicitly and I wish it did, but absent that, I think the spec strongly hints at the behavior I'm wishing for. Here are two quotes from the IGNORE/IGNORABLE spec page (they're one after the other):

Exhibit 1:

"The ignore and ignorable declarations refer to for-value references to variable bindings for the vars and to function bindings for the fns."

Exhibit 2:

"An ignore declaration specifies that for-value references to the indicated bindings will not occur within the scope of the declaration."

First of all, notice how it's said in both places that this affects *for-value references*, not the variable bindings themselves. To me this indicates that IGNORE/IGNORABLE are free declarations, not bound declarations. The IGNORE declaration is saying "There will be no for-value references to this binding within my scope.", not "This binding will not be referenced from anywhere".

This situation is similar to a TYPE declaration referring to a variable of an enclosing scope, where only for-value references are affected, not the binding itself.

Second, within Exhibit 2, notice that it's said that for-value references to the indicated bindings will not occur *within the scope of the declaration*. Why would this last bit be mentioned at all if it was the case that IGNORE/IGNORABLE declarations are bound-only and only ever affect bindings introduced by the form carrying these declarations??

----

By the way, I still think that the following should get a STYLE-WARNING, despite the apparent status of these declarations as free declarations:

(let* ((x 8)
       (y x))
  (declare (ignore x))
  y)