prelude

package
v0.3.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 23, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package prelude lists the names the prelude binds in every module (sections 10 and 11).

Index

Constants

View Source
const Path = "prelude.d.ant"

Path is the prelude's file name, a declaration file (section 10, Declaration files): the path its declarations carry and the document an editor opens for one, ant:/prelude.d.ant.

Variables

View Source
var Layout = sync.OnceValue(func() *parser.Layout {
	_, l, _ := parser.ParseLayout(Path, source)
	return l
})

Layout returns the prelude's layout, for an editor that shows its document, made once.

View Source
var Names = []string{
	"print", "println", "eprint", "eprintln", "panic", "assert", "len",
	"int8", "int16", "int32", "int64", "uint8", "uint16", "uint32", "uint64",
	"float32", "float64", "int", "byte", "string", "bool",
	"never", "Integer", "Number", "Ordered", "Seq", "Entry", "Indexed",
	"Error", "Panic", "Ok", "Err", "Result",
	"Array", "Map", "Set", "String", "Regex", "Iter", "Math", "Bits", "Random", "Record",
	"Bytes", "Html", "Mutex", "RwMutex", "WaitGroup", "Once", "Cond", "Atomic", "Context", "Channel",
	"Parallel", "Reflect",
	"File", "Http", "Net", "Path", "Time", "Os", "Cmd", "Json", "Csv", "Encoding", "Url", "Crypto",
	"Test",
}

Names are the prelude's bindings: the functions, the conversion names, the types, and the namespaces. No declaration in any scope may shadow one (section 10).

Functions

func Decls

func Decls() (*ast.File, error)

Decls returns the prelude's declarations, parsed once.

func IsName

func IsName(name string) bool

IsName reports whether name is a prelude name.

func NamespaceDoc

func NamespaceDoc(name string) (string, string)

NamespaceDoc returns the namespace name, matched without regard to case, as the prelude spells it, with its doc, or "", "" when it has none. A namespace's doc is the paragraph under its section label in the prelude, a run of comments of its own between blank lines: "// Array", an empty "//", and the text.

func Source

func Source() string

Source is the text of prelude.d.ant, which an editor shows for a prelude declaration.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL