From: Olof-Joachim Frahm Date: Mon, 10 Jun 2013 22:03:57 +0000 (+0200) Subject: Add DFLET, PROGF to API documentation. X-Git-Tag: 1.0.0~8 X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;ds=sidebyside;h=1a2e36396744a61bf408c752467225bc728772d5;p=cl-mock.git Add DFLET, PROGF to API documentation. --- 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