From 21b30c8c1e079db8587fc76286140c4d5213d6f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kochma=C5=84ski?= Date: Tue, 6 Sep 2016 08:54:46 +0200 Subject: [PATCH] newdoc: add comment about the ext:*load-hooks* --- src/doc/new-doc/standards/index.txi | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/doc/new-doc/standards/index.txi b/src/doc/new-doc/standards/index.txi index e33e6b6a0..804e831d9 100644 --- a/src/doc/new-doc/standards/index.txi +++ b/src/doc/new-doc/standards/index.txi @@ -114,6 +114,34 @@ @node System construction @section System construction +@c ext:*load-hooks*, si::*load-search-list* variable: + +@c EXT:*LOAD-HOOKS* is an assoc array of form ((TYPE . LOAD-FUNCTION)), +@c where TYPE is either a string (i.e "lisp", "fasb" etc.), wildcard +@c :WILD (matching any extension) and NIL for no +@c extension. LOAD-FUNCTION is a symbol of a function used to load the +@c file of the TYPE type. + +@c If the argument SOURCE of LOAD is a stream, it is read as an ordinary +@c lisp source code, otherwise it should a pathname (or a string which +@c may be coerced to it). + +@c If pathname doesn't have a directory, host nor device components, +@c then file is looked in the `:SEARCH-LIST` directories (defaulting to +@c si::*load-search-list*) and if found – loaded with LOAD (with +@c pathname with a directory merged from the search-list). + +@c Otherwise (if a pathname does have a directory or the file can't be +@c found in the SEARCH-LIST) and the file type is neither NIL or :WILD, +@c then the assoc value of the TYPE is looked up in EXT:*LOAD-HOOKS* and +@c funcalled on the file (if the TYPE doesn't exist, we load a file as a source code). + +@c If file type is NIL or :WILD, then we try to "guess" it's extension +@c trying extensions from the EXT:*LOAD-HOOKS* in order in which they +@c appear on the list. By default, first entry is (NIL +@c . SI:LOAD-SOURCE), so if there is a file without extension in the +@c directory, it will be treated as a source code. Otherwise we'll try +@c known extensions. @node Environment @section Environment