[climacs-cvs] CVS climacs

thenriksen thenriksen at common-lisp.net
Tue Jan 15 10:43:40 UTC 2008


Update of /project/climacs/cvsroot/climacs
In directory clnet:/tmp/cvs-serv1603

Modified Files:
	climacs-lisp-syntax.lisp 
Log Message:
Also consider macrolet to define local functions.


--- /project/climacs/cvsroot/climacs/climacs-lisp-syntax.lisp	2008/01/10 11:22:03	1.10
+++ /project/climacs/cvsroot/climacs/climacs-lisp-syntax.lisp	2008/01/15 10:43:40	1.11
@@ -342,13 +342,18 @@
        'cl:function)
       (t t))))
 
+(defvar *local-function-definers* '(flet labels macrolet)
+  "A list of macros that define local functions, as per
+`find-local-definition.")
+
 (defun find-local-definition (syntax symbol-form)
   "Return a form locally defining `symbol-form' as a
 function (explicitly via `flet' or `labels', does not expand
 macros or similar). If no such form can be found, return NIL."
   (labels ((locally-binding-p (form)
-             (or (form-equal syntax (form-operator form) "FLET")
-                 (form-equal syntax (form-operator form) "LABELS")))
+             (find-if #'(lambda (symbol)
+                          (form-equal syntax (form-operator form) (string symbol)))
+                      *local-function-definers*))
            (match (form-operator)
              (when form-operator
                (form-equal syntax form-operator symbol-form)))




More information about the Climacs-cvs mailing list