evalwon't add method to generic function. Well
libraryform is not allowed to evaluate with
evalon both R6RS and R7RS however Sagittarius allows it. (And I might have already written such code ...)
So forget about thread local storage. For now
add-methodchecks current environment whether or not it's a child environment which is created by either
environmentprocedure or a thread. The name child environment may confuse you but I just don't have any good name for this, so bare with it :) If
add-methodis called in child environment then it adds method to only in that context. If not, then adds globally.
Difference? Well sort of the same but it has now a way to affect changes globally. In the remote REPL situation discussed in previous article comment, it can be done with
with-librarymacro. Other changes are only in the child context.
;; in remote REPL and we want to apply a patch (import (sagittarius control)) (with-library (foo) ;; fix it (define-method bar ...))This is just a fix before I forget, so it's time to read the paper.