(guile.info.gz) Loading
Info Catalog
(guile.info.gz) Fly Evaluation
(guile.info.gz) Read/Load/Eval
(guile.info.gz) Delayed Evaluation
28.4 Loading Scheme Code from File
==================================
-- Scheme Procedure: load filename
Load FILENAME and evaluate its contents in the top-level
environment. The load paths are not searched. If the variable
`%load-hook' is defined, it should be bound to a procedure that
will be called before any code is loaded. See documentation for
`%load-hook' later in this section.
-- Scheme Procedure: load-from-path filename
Similar to `load', but searches for FILENAME in the load paths.
-- Scheme Procedure: primitive-load filename
-- C Function: scm_primitive_load (filename)
Load the file named FILENAME and evaluate its contents in the
top-level environment. The load paths are not searched; FILENAME
must either be a full pathname or be a pathname relative to the
current directory. If the variable `%load-hook' is defined, it
should be bound to a procedure that will be called before any code
is loaded. See the documentation for `%load-hook' later in this
section.
-- Scheme Procedure: primitive-load-path filename
-- C Function: scm_primitive_load_path (filename)
Search %LOAD-PATH for the file named FILENAME and load it into the
top-level environment. If FILENAME is a relative pathname and is
not found in the list of search paths, an error is signalled.
-- Scheme Procedure: %search-load-path filename
-- C Function: scm_sys_search_load_path (filename)
Search %LOAD-PATH for the file named FILENAME, which must be
readable by the current user. If FILENAME is found in the list of
paths to search or is an absolute pathname, return its full
pathname. Otherwise, return `#f'. Filenames may have any of the
optional extensions in the `%load-extensions' list;
`%search-load-path' will try each extension automatically.
-- Variable: %load-hook
A procedure to be run whenever `primitive-load' is called. If this
procedure is defined, it will be called with the filename argument
that was passed to `primitive-load'.
(define %load-hook (lambda (file)
(display "Loading ")
(display file)
(write-line "...."))) => undefined
(load-from-path "foo.scm")
-| Loading /usr/local/share/guile/site/foo.scm....
-- Scheme Procedure: current-load-port
-- C Function: scm_current_load_port ()
Return the current-load-port. The load port is used internally by
`primitive-load'.
-- Variable: %load-extensions
A list of default file extensions for files containing Scheme code.
`%search-load-path' tries each of these extensions when looking for
a file to load. By default, `%load-extensions' is bound to the
list `("" ".scm")'.
Info Catalog
(guile.info.gz) Fly Evaluation
(guile.info.gz) Read/Load/Eval
(guile.info.gz) Delayed Evaluation
automatically generated byinfo2html