Next: Lexical Conventions, Previous: Files and Ports, Up: The Language [Contents][Index]
If the string filename names an existing file, the try-load
procedure reads Scheme source code expressions and definitions from the
file and evaluates them sequentially and returns #t
. If not,
try-load returns #f
. The try-load procedure does not affect the
values returned by current-input-port
and
current-output-port
.
Is set to the pathname given as argument to load
,
try-load
, and dyn:link
(see Compiling And Linking in Hobbit).
*load-pathname*
is used to compute the value of
program-vicinity in SLIB.
Returns the result of reading an expression from str and
evaluating it. eval-string
does not change
*load-pathname*
or line-number
.
Reads and evaluates all the expressions from str. As with
load
, the value returned is unspecified. load-string
does
not change *load-pathname*
or line-number
.
Returns the current line number of the file currently being loaded.
Previous: Eval and Load, Up: Eval and Load [Contents][Index]
Scheme code defined by load may optionally contain line number information. Currently this information is used only for reporting expansion time errors, but in the future run-time error messages may also include line number information.
This is the primitive for loading, pathname is the name of
a file containing Scheme code, and optional argument reader is
a function of one argument, a port. reader should read and
return Scheme code as list structure. The default value is read
,
which is used if reader is not supplied or is false.
Line number objects are disjoint from integers or other Scheme types. When evaluated or loaded as Scheme code, an s-expression containing a line-number in the car is equivalent to the cdr of the s-expression. A pair consisting of a line-number in the car and a vector in the cdr is equivalent to the vector. The meaning of s-expressions with line-numbers in other positions is undefined.
Behaves like read
, except that
Returns a line-number object with value int. int should be an exact non-negative integer.
Returns the value of line-number object linum as an integer.
Returns true if and only if obj is a line-number object.
Behaves like read
, except that load syntaxes are enabled.
The value of *load-reader*
should be a value acceptable as
the second argument to try-load
(note that #f is acceptable).
This value will be used to read code during calls to scm:load
.
The value of *slib-load-reader*
will similarly be used during
calls to slib:load
and require
.
In order to disable all line-numbering, it is sufficient to set!
*load-reader*
and *slib-load-reader*
to #f.
Next: Lexical Conventions, Previous: Files and Ports, Up: The Language [Contents][Index]