On this page:
current-dye-packs
call-with-disarmed-dye-packs
with-disarmed-dye-packs
rearm-dye-packs
module-code-inspector
7.1
3.3.2 mischief/dye-pack: Protecting Syntax Objects

 (require mischief/dye-pack) package: mischief

parameter

(current-dye-packs)  syntax?

(current-dye-packs stx)  void?
  stx : syntax?
Stores the syntax object used for arming and disarming dye packs in the current syntax transformer.

procedure

(call-with-disarmed-dye-packs stx    
  proc    
  [#:inspector inspector])  any
  stx : syntax?
  proc : (-> syntax? any)
  inspector : (or/c inspector? #false) = #false
Calls proc with a version of stx whose dye packs are disarmed using insp. Stores the original stx in current-dye-packs during the execution of proc.

Equivalent to:
(parameterize {[current-dye-packs stx]}
  (proc (syntax-disarm stx inspector)))

syntax

(with-disarmed-dye-packs name-id stx-expr body ...+)

Executes body with name-id bound to a disarmed version of stx-expr using the declaration inspector for the enclosing module. Stores the value of the original stx-expr in current-dye-packs during the execution of proc.

Equivalent to:
(call-with-disarmed-dye-packs stx-expr
  #:inspector (module-code-inspector)
  (lambda {name-id} body ...))

procedure

(rearm-dye-packs stx    
  [#:dye-packs dye-packs    
  #:mode mode])  syntax?
  stx : syntax?
  dye-packs : syntax? = (current-dye-packs)
  mode : any/c = #false
Produces a version of stx in which the dye packs on dye-packs are rearmed. If mode is #false, always rearms the dye packs for the whole syntax object. If mode is a non-symbol true value, the dye packs are pushed to nested syntax objects in accordance with the 'taint-mode syntax property. If mode is a symbol, sets the 'taint-mode property of stx to mode and then rearms according to it.

Produces the declaration inspector for the enclosing module. Equivalent to: