diff options
author | Kevin Ryde <user42@zip.com.au> | 2005-01-14 23:55:07 +0000 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2005-01-14 23:55:07 +0000 |
commit | 42ad91f74248ced981abfedbc2787518c90b79e9 (patch) | |
tree | 1e2f34d1f2c7a2d84fda057124c0372dd7fc23f5 /doc/ref/api-evaluation.texi | |
parent | 4497bd2f81fce2e5c7240c9babbbc8ecc8ac73a9 (diff) | |
download | guile-42ad91f74248ced981abfedbc2787518c90b79e9.tar.gz |
(Loading): In %load-hook, need to use set!, and describe #f.
Diffstat (limited to 'doc/ref/api-evaluation.texi')
-rw-r--r-- | doc/ref/api-evaluation.texi | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/doc/ref/api-evaluation.texi b/doc/ref/api-evaluation.texi index 7cfb7e8ef..c6934df18 100644 --- a/doc/ref/api-evaluation.texi +++ b/doc/ref/api-evaluation.texi @@ -451,19 +451,20 @@ will try each extension automatically. @end deffn @defvar %load-hook -A procedure to be run whenever @code{primitive-load} is called. If this -procedure is defined, it will be called with the filename argument that -was passed to @code{primitive-load}. +A procedure to be called @code{(%load-hook @var{filename})} whenever a +file is loaded, or @code{#f} for no such call. @code{%load-hook} is +used by all of the above loading functions (@code{load}, +@code{load-path}, @code{primitive-load} and +@code{primitive-load-path}). + +For example an application can set this to show what's loaded, @example -(define %load-hook (lambda (file) - (display "Loading ") - (display file) - (write-line "...."))) @result{} undefined +(set! %load-hook (lambda (filename) + (format #t "Loading ~a ...\n" filename))) (load-from-path "foo.scm") -@print{} Loading /usr/local/share/guile/site/foo.scm.... +@print{} Loading /usr/local/share/guile/site/foo.scm ... @end example - @end defvar @deffn {Scheme Procedure} current-load-port |