wanted: push/pop declarations or similar

Bug #720615 reported by Nikodemus Siivola
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Triaged
Wishlist
Unassigned

Bug Description

From sbcl-devel, by Tobias Rittweiler:

Say you want to get rid of compiler-notes for a very specific
area of code inside a macro. However, the following won't cut it:

 `(locally (declare (sb-ext:muffle-conditions sb-ext:compiler-note)
    (with-foo (...)
      (declare (sb-ext:unmuffle-conditions sb-ext:compiler-note))
      ,@body))

The reason why that is not sufficient is because inside WITH-FOO
we'll unconditionally unmuffle compiler-notes even though there
may a global muffling declaration active.

Presumably you can get at the list of currently muffled condition
from a macro's &environment object, so you can probably write the
above as

 (let ((muffled-conditions (get-declaration 'sb-ext:muffle-conditions
env)))
   `(locally (declare (sb-ext:muffle-conditions sb-ext:compiler-note)
      (with-foo (...)
        (declare (sb-ext:unmuffle-conditions sb-ext:compiler-note))
        (declare (sb-ext:muffle-conditions ,@muffled-conditions))
        ,@body)))

I'm wondering if this warrants a new declaration REMUFFLE-CONDITIONS?

Tags: feature
Revision history for this message
Nikodemus Siivola (nikodemus) wrote :

Similar issue probably affects ENABLE-PACKAGE-LOCKS and DISABLE-PACKAGE-LOCKS.

summary: - declaration scope and muffle/unmuffle-conditions
+ wanted: push/pop declarations or similar
Changed in sbcl:
importance: Low → Wishlist
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.