4 ;;; Lucid initializations
5 ;;; Author: Chris McConnell, ccm@cs.cmu.edu
7 ;;; This file is part of ILISP.
8 ;;; Please refer to the file COPYING for copyrights and licensing
10 ;;; Please refer to the file ACKNOWLEGDEMENTS for an (incomplete) list
11 ;;; of present and past contributors.
13 ;;; $Id: lucid.lisp,v 1.4 2002-05-30 13:59:21 wbd Exp $
18 (defun ilisp-callers (symbol package &aux (list-of-callers nil))
19 "Print the callers of PACKAGE::SYMBOL. Only compiled functions
20 currently. Return T if successful."
22 (let ((function-name (ilisp-find-symbol symbol package))
25 (*package* (find-package 'lisp)))
26 (when (and function-name (fboundp function-name))
28 ((check-symbol (symbol)
30 ((check-function (function &optional exclusions)
32 ((>= i (lucid::procedure-length function)))
33 (let ((element (sys:procedure-ref function i)))
34 (cond ((eq element function-name)
35 (pushnew symbol list-of-callers))
36 ((and (compiled-function-p element)
37 (not (find element exclusions)))
40 (cons element exclusions))))))))
41 (check-function (symbol-function symbol)))))
42 (do-all-symbols (symbol)
43 (when (fboundp symbol)
44 (check-symbol symbol)))
45 (dolist (caller list-of-callers)
50 (defun ilisp-source-files (symbol package type)
51 "Print each file for PACKAGE:SYMBOL's TYPE definition on a line and
52 return T if successful."
54 (let* ((symbol (ilisp-find-symbol symbol package))
55 (all (equal type "any"))
56 (type (unless all (ilisp-find-symbol type package)))
58 (lucid::get-source-file symbol type all))))
62 (dolist (file (remove-duplicates paths
63 :key #'cdr :test #'equal))
64 (print (namestring (cdr file))))
65 (print (namestring paths)))
70 (dolist (symbol '(ilisp-callers ilisp-source-files))
72 (unless (compiled-function-p #'ilisp-callers)
73 (format t "\"ILISP: File is not compiled, use M-x ilisp-compile-inits\""))