OxL Reference

2.2 Import

oxl
use std.time { Duration, now }
use std.http.{Client as Http}
use self.billing { charge }      // a module of one's own package
use super.common { Money }       // the parent module
use auth.tokens { verify }       // a dependency from oxl.toml
use parsers { <|> }              // importing an operator
use std.coll.*                   // all pub names (a warning in libraries)

The first segment of the path MUST be std, self, super or the name of a dependency from oxl.toml. An unused import is a warning. A name conflict between two imports is an error if the name is used.

The prelude std.core is imported automatically: primitives, Option, List, Map, Set, Task, stream, iter, print, env, now, sleep, panic, the standard interfaces (§4.6).

dbg(x: T) -> T (prelude) prints to stderr the line [file:line] expression_text = value (traceId: id) (the value via Show; traceId is the trace identifier of the current task or -) and returns x; it can wrap any subexpression. It has no effects. The prod profile strips the output (the expression itself remains); the profile key dbg = true brings it back (D-8064; D-7800, D-7840).

bad-import-root, glob-import, import-conflict, unresolved-import, unresolved-name

See also

Source: docs/spec/oxl-standard.en.md