4 ;;; ILISP Franz ACL dialect support definitions.
6 ;;; This file is part of ILISP.
7 ;;; Please refer to the file COPYING for copyrights and licensing
9 ;;; Please refer to the file ACKNOWLEGDEMENTS for an (incomplete) list
10 ;;; of present and past contributors.
12 ;;; $Id: allegro.lisp,v 1.4 2002-05-30 13:59:20 wbd Exp $
14 ;;; Allegro initializations
15 ;;; Author: Chris McConnell, ccm@cs.cmu.edu
19 ;;; 20001203 Patch suggested by Larry Hunter <Larry.Hunter@uchsc.edu>
20 ;;; EXCL::FN_SYMDEF is no longer available by default.
22 #+(or allegro-v5.0 allegro-v6.0 allegro-v6.1) (eval-when (compile load) (require
26 (defun ilisp-callers (symbol package)
27 "Print a list of all of the functions that call FUNCTION.
28 Returns T if successful."
30 (let ((function (ilisp-find-symbol symbol package))
34 (*package* (find-package 'lisp)))
35 (when (and function (fboundp function))
36 (labels ((in-expression (function expression)
37 (cond ((null expression) nil)
39 (let ((header (first expression)))
40 (if (or (eq header function)
41 (and (eq header 'function)
42 (eq (second expression) function)))
44 (dolist (subexp expression)
45 (when (in-expression function subexp)
50 (push (excl::fn_symdef function) callers)))
51 (do-all-symbols (symbol)
52 (when (and (fboundp symbol)
53 (not (compiled-function-p (symbol-function symbol)))
54 (in-expression function (symbol-function symbol)))
55 (push symbol callers)))
56 (dolist (caller callers)
61 (defun ilisp-source-files (symbol package type)
62 "Print each file for PACKAGE:SYMBOL's TYPE definition on a line.
63 Returns T if successful."
65 (let* ((symbol (ilisp-find-symbol symbol package))
66 (type (if (equal type "any") t (ilisp-find-symbol type "keyword")))
67 (paths (when symbol (excl:source-file symbol type))))
71 (dolist (path (remove-duplicates paths
72 :key #'cdr :test #'equal))
73 (print (namestring (cdr path))))
74 (print (namestring paths)))
78 ;;;===========================================================================
81 (eval-when (load eval)
82 (unless (compiled-function-p #'ilisp-callers)
83 (ilisp-message t "File is not compiled, use M-x ilisp-compile-inits")))
85 ;;; end of file -- allegro.lisp --