Browse files

Clarify interactive reloading with vars in readme.

  • Loading branch information...
1 parent cc06fea commit 0000b1da40ba5d66eb636741e0347086d0defa3d @technomancy committed Jan 16, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4
@@ -73,9 +73,11 @@ impossible to add further methods. Hooks are meant to extend functions
you don't control; if you own the target function there are obviously
better ways to change its behaviour.
-When adding hooks be sure to use Var objects for both to ensure
-consistency between what you get in your REPL and your compiled code,
+When adding hooks it's best to use vars instead of raw functions in
+order to allow the code to be reloaded interactively. If you recompile
+a function, it will be re-added as a hook, but if you use a var it
+will be able to detect that it's the same thing across reloads and
+avoid duplication.
(add-hook #'some.ns/target-var #'hook-function)
@@ -108,6 +110,6 @@ stripped out:
## License
-Copyright (C) 2010 Phil Hagelberg and Kevin Downey
+Copyright © 2010-2011 Phil Hagelberg and Kevin Downey
Distributed under the Eclipse Public License, the same as Clojure.

0 comments on commit 0000b1d

Please sign in to comment.