/[climacs]/climacs/climacs-lisp-syntax.lisp
ViewVC logotype

Diff of /climacs/climacs-lisp-syntax.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by thenriksen, Thu Jan 10 11:22:03 2008 UTC revision 1.11 by thenriksen, Tue Jan 15 10:43:40 2008 UTC
# Line 342  Each newline and following whitespace is Line 342  Each newline and following whitespace is
342         'cl:function)         'cl:function)
343        (t t))))        (t t))))
344    
345    (defvar *local-function-definers* '(flet labels macrolet)
346      "A list of macros that define local functions, as per
347    `find-local-definition.")
348    
349  (defun find-local-definition (syntax symbol-form)  (defun find-local-definition (syntax symbol-form)
350    "Return a form locally defining `symbol-form' as a    "Return a form locally defining `symbol-form' as a
351  function (explicitly via `flet' or `labels', does not expand  function (explicitly via `flet' or `labels', does not expand
352  macros or similar). If no such form can be found, return NIL."  macros or similar). If no such form can be found, return NIL."
353    (labels ((locally-binding-p (form)    (labels ((locally-binding-p (form)
354               (or (form-equal syntax (form-operator form) "FLET")               (find-if #'(lambda (symbol)
355                   (form-equal syntax (form-operator form) "LABELS")))                            (form-equal syntax (form-operator form) (string symbol)))
356                          *local-function-definers*))
357             (match (form-operator)             (match (form-operator)
358               (when form-operator               (when form-operator
359                 (form-equal syntax form-operator symbol-form)))                 (form-equal syntax form-operator symbol-form)))

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

  ViewVC Help
Powered by ViewVC 1.1.5