include "sys.m"; sys := load Sys Sys->PATH; include "draw.m"; draw := load Draw Draw->PATH; include "tk.m"; tk := load Tk Tk->PATH; ... etc. Generically:
include "module.m";module := load Module Module->PATH;
Although many modules are self-contained, dependencies may exist. For example, the system module, Sys, provides basic services that many other modules require. These are the Inferno equivalent to `system calls'.
In a few cases, several related modules share a single include file; for instance, security.m.
The manual pages describe how to include a module definition during compilation and load an implementation during execution. The documentation also lists relevant functions or abstract data types. Although the include files declare these components, the manual pages list them explicitly. In all cases, the enclosing module declaration is assumed so that unqualified identifiers can be used in the text without ambiguity, reducing clutter in the text. In practice when programming, many consider it good style to use an explicit module reference for functions and constants.
The Limbo modules are identical on any machine that is running Inferno, whether native or hosted, which enables Limbo programs to be written and tested on any Inferno system.
Many modules are described in a single page, such as regex(2). Several larger modules are explained in several sections, such as math-intro(2), math-elem(2), math-fp(2), and math-linalg(2).
There are currently two more classes of exception string with a conventional interpretation imposed not by the run-time system proper, but by Limbo components:
Otherwise, most module interfaces tend to use explicit error return values, not exceptions.
Note that a Limbo exception handler can do pattern matching to catch a class of exceptions:
{ body of code to protect } exception e { "out of memory:*" => recovery action "assertion:*" => fatal_error(e); }
The effect of an unhandled exception in a process that is part of an error-recovery group can be controlled using the mechanisms described in prog(3) as accessed using exception(2).
INTRO(2 ) | Rev: Thu Feb 15 14:43:27 GMT 2007 |