6.2 The Source File Recording Facility

6.2.2 Source file recording examples

The following examples illustrate the effects of source file recording on redefinition warnings.

;;; Suppose the files "file-a.lisp" and "file-b.lisp" both 
;;; contain definitions of the function DOIT.

;; Loading "file-a" defines DOIT for the first time. > (load "file-a") ;;; Loading source file "file-a.lisp" #P"/u/kdo/file-a.lisp"

;; Now, loading "file-b", which also defines DOIT, produces a ;; warning. > (load "file-b") ;;; Loading source file "file-b.lisp" ;;; Warning: Redefining function DOIT which used to be defined in ;;; "/u/kdo/file-a.lisp" #P"/u/kdo/file-b.lisp"

;; Reloading the same file produces no warning. > (load "file-b") ;;; Load source file "file-b.lisp". #P"/u/kdo/file-b.lisp"

;; Get the pathname of the source file. > (get-source-file 'doit) #P"/u/kdo/file-b.lisp"


The Advanced User's Guide - 9 SEP 1996

Generated with Harlequin WebMaker