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.
read, except that
- Load (read) sytnaxes are enabled.
- every s-expression read will be replaced with a cons of a line-number object and the sexp actually read. This replacement is done only if port is a tracked port See See Files and Ports.
Returns a line-number object with value int. int should be an exact non-negative integer.
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
In order to disable all line-numbering, it is sufficient to set!