X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=README.md;fp=README.md;h=667b5d215431ea181f22b5223389d3c0ae7908ef;hb=1a2e36396744a61bf408c752467225bc728772d5;hp=2a0e10b208f0d195b0cb75c24fcbf42e1ab62dfd;hpb=e9132a193bc1e4d3cc10b9a2d57d0844a8a9a06f;p=cl-mock.git diff --git a/README.md b/README.md index 2a0e10b..667b5d2 100644 --- a/README.md +++ b/README.md @@ -18,4 +18,28 @@ Some parts may be used independently of the testing facilities, e.g. dynamic `FLET` and method bindings with `PROGM` may be of general interest. + +# UTILITIES + +`DFLET` dynamically rebinds functions similar to `FLET`: + + > (defun foo () 42) + > (defun bar () (foo)) + > (bar) + > => 42 + > (dflet ((foo () 23)) + > (bar)) + > => 23 + > (OR) => 42, if FOO was inlined + +The caveat is that this might not work on certain optimization settings. + +The underlying function `PROGF` may be used as well similarly to standard +`PROG`: + + > (progf '(foo) (list (lambda () 23)) + > (bar)) + > => 23 + > (OR) => 42, if FOO was inlined + [1]: http://common-lisp.net/project/closer/closer-mop.html