Documentation
¶
Overview ¶
Package bootstrap performs initial setup of the Ale runtime environment. It populates a new Environment with all core functions, macros, special forms, and standard library definitions. Create a new `*env.Environment` and pass it to `Into` to initialize a complete Ale runtime ready for code evaluation.
Index ¶
- Constants
- func BindFileSystem(ns env.Namespace, f fs.FS) error
- func DevNull(e *env.Environment)
- func DevNullEnvironment() *env.Environment
- func Into(e *env.Environment)
- func MustBindFileSystem(ns env.Namespace, f fs.FS)
- func ProcessArgs(e *env.Environment)
- func ProcessEnv(e *env.Environment)
- func StandardIO(e *env.Environment)
- func TopLevelEnvironment() *env.Environment
Constants ¶
const ( ErrCannotDeclareFS = "failed to declare filesystem: %w" ErrCannotBindFS = "failed to bind filesystem: %w" )
Error messages
const ( // ErrBuiltInNotFound is raised when a built-in procedure can't be resolved ErrBuiltInNotFound = "built-in not found: %s" // ErrSpecialNotFound is raised when a built-in special can't be resolved ErrSpecialNotFound = "special form not found: %s" // ErrMacroNotFound is raised when a built-in macro can't be resolved ErrMacroNotFound = "macro not found: %s" )
const InitFile = "bootstrap.ale"
Variables ¶
This section is empty.
Functions ¶
func BindFileSystem ¶ added in v0.3.0
BindFileSystem binds a file system to a Namespace to enable source includes and other file operations. The file system is private to the Namespace
func DevNull ¶
func DevNull(e *env.Environment)
DevNull binds *in*, *out*, and *err* to the operating system's bit bucket device (usually /dev/null)
func DevNullEnvironment ¶
func DevNullEnvironment() *env.Environment
DevNullEnvironment configures a bootstrapped environment completely isolated from the top-level of the system. All I/O is rerouted to and from the operating system's bit bucket device (usually /dev/null)
func Into ¶
func Into(e *env.Environment)
Into sets up initial built-ins and populateAssets. Useful if you're wiring up your own Environments. Otherwise, calls to TopLevelEnvironment and DevNullEnvironment will perform this action for you.
func MustBindFileSystem ¶ added in v0.3.0
MustBindFileSystem binds a file system to a Namespace or panics if it can't
func ProcessArgs ¶
func ProcessArgs(e *env.Environment)
ProcessArgs binds *args* to the current Go app's command line arguments
func ProcessEnv ¶
func ProcessEnv(e *env.Environment)
ProcessEnv binds *env* to the operating system's environment variables
func StandardIO ¶
func StandardIO(e *env.Environment)
StandardIO binds *in*, *out*, and *err* to the operating system's standard input and output facilities
func TopLevelEnvironment ¶
func TopLevelEnvironment() *env.Environment
TopLevelEnvironment configures an environment that could be used at the top-level of the system, such as the REPL. It has access to the *env*, *args*, and operating system's standard in/out/err file streams.
Types ¶
This section is empty.