Prelude
The following items are available globally in every Do program without any
import statement.
The dolang executable layers its
shell prelude on top of this core prelude.
Embedded runtimes may provide a different additional prelude.
std
| Name | Description |
|---|---|
Array |
Array type |
array |
Variadic array factory |
Bin |
Bin type |
BinBuf |
Mutable byte buffer |
Bool |
Bool type |
bool |
Truthiness coercion |
class |
Inherited class member decorator |
dbg |
Debug representation |
Dict |
Dict type |
dict |
Variadic dictionary factory |
fields |
Proxy for a value's public fields |
final |
Decorator forbidding subclasses |
Float |
Float type |
float |
Numeric coercion and parsing |
Func |
Func type |
getter |
Class field getter decorator |
Int |
Int type |
int |
Integer coercion and parsing |
Iter |
Iterator type |
Iterable |
Iterable value type |
mixable |
Decorator allowing combination with unrelated classes |
Range |
Range type |
Record |
Record type |
record |
Variadic record factory |
Set |
Set type |
setter |
Class field setter decorator |
Sink |
Sink type |
Sinkable |
Type of values that provide sinks |
static |
Uninherited class member decorator |
Str |
Str type |
str |
Textual representation |
StrBuf |
Mutable string buffer |
Struct |
Struct type |
struct |
Variadic struct factory |
Sym |
Sym type |
sym |
Symbol interning |
Tuple |
Tuple type |
tuple |
Variadic tuple factory |
Type |
Type type |
type |
Type query and test function |
Value |
Supertype of all values |
Checker-only names from std
These names are available in annotations without an import. They do not bind
runtime values, including BaseArray and
BaseDict, which are runtime classes. Use a qualified name or
an explicit runtime import to use those classes as values.
| Names | Purpose |
|---|---|
Never, Union |
Empty type and unions, including expanded schemas |
Seq, AssignSeq, MutSeq |
Sequences and their mutation capabilities |
Map, AssignMap, MutMap |
Dictionary-like reads, assignment, and removal |
Index, Assign, Spread, Unpack |
Indexing, assignment, spreading, and destructuring |
BaseIterable, BaseIter, BaseSinkable, BaseSink |
Minimal iteration and sink protocols |
UnpackIter, UnpackIterable |
Iteration with read-only unpacking |
BaseArray, BaseDict |
Native container read-only interfaces |
strand
The module itself is imported, along with these functions:
| Name | Description |
|---|---|
fork |
Executes blocks concurrently |
pipeline |
Connects concurrent pipeline stages |
stream |
Creates a background stream strand |
put |
Writes to the strand-local output |
spawn |
Creates a background strand |