Ignore:
Timestamp:
Mar 29, 2008, 1:41:15 PM (12 years ago)
Author:
mb
Message:

More fixes to make ccl::%source-files work like it used to.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/lib/source-files.lisp

    r8929 r8933  
    462462
    463463(defun %source-files (name)
    464   (mapcar (lambda (def)
    465             (let ((def-type (first def))
    466                   (file (source-note-file-name (third def))))
    467               (cons (if (eql 'method def-type)
    468                       (%find-method-from-definition-name (second def))
    469                       def-type)
    470                     file)))
    471           (gethash name *source-files*)))
     464  "Finds the definitions of NAME.
     465
     466If NAME only names a function or macro returns the file the function is defined in.
     467
     468If NAME only names a generic-function returns a list of the form: ((METHOD . METHOD-PAIRS)). METHOD
     469is the symbol METHOD pairs is a list of (METHOD-OBJECT . FILE-NAME).
     470
     471"
     472  (loop
     473    for (type name source-note) in (find-definitions-for-name name)
     474    if (member type '(method 'reader-method 'writer-method))
     475      collect (cons (%find-method-from-definition-name name)
     476                    (source-note-file-name source-note))
     477      into method-definitions
     478    else
     479      collect (cons (case type
     480                      ((function macro) 'function)
     481                      (callback         'defcallback)
     482                      (t type))
     483                    (source-note-file-name source-note))
     484      into other-definitions
     485    finally (return (cond
     486                      ((and method-definitions other-definitions)
     487                       (cons (cons 'method method-definitions)
     488                             other-definitions))
     489                      (method-definitions (cons 'method method-definitions))
     490                      (other-definitions
     491                       (if (and (= 1 (length other-definitions))
     492                                (member (car (first other-definitions)) '(function compiler-macro macro)))
     493                         (cdr (first other-definitions))
     494                         other-definitions))))))
    472495
    473496;;;; * Done loading the r-s-f stuff. Do some housekeeping.
Note: See TracChangeset for help on using the changeset viewer.