Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

Commit

Permalink
Merge pull request #11 from hugoduncan/document-scopes
Browse files Browse the repository at this point in the history
Document hook-scope in README
  • Loading branch information
technomancy committed Oct 10, 2012
2 parents e0d1148 + 9049ac0 commit 76eabb5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -108,6 +108,22 @@ stripped out:
(print-name "Alan Moore")) (print-name "Alan Moore"))
> Alan Moore > Alan Moore


The `hook-scope` macro provides a scope which records any change to hooks during
the dynamic scope of its body, and restores hooks to their original state on
exit of the scope. Note that all threads share the scope. Using the example
functions above:

(examine "something")
> something

(hook-scope
(add-hook #'examine #'microscope)
(examine "something"))
> SOMETHING

(examine "something")
> something

## License ## License


Copyright © 2010-2011 Phil Hagelberg and Kevin Downey Copyright © 2010-2011 Phil Hagelberg and Kevin Downey
Expand Down

0 comments on commit 76eabb5

Please sign in to comment.