core

package
v0.0.0-...-6b669e2 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InitCommands = []string{
	`(def! not (fn* (a) (if a false true)))`,
	`(def! load-file (fn* (f) (eval (read-string (str "(do " (slurp f) "\nnil)")))))`,
}

InitCommands contain mal commands to be executed in sequence during initialization

View Source
var NameSpace = map[string]types.MalFunction{

	"+": add,
	"-": sub,
	"*": mul,
	"/": div,

	"pr-str":      strReadable,
	"str":         strUnreadable,
	"prn":         printReadable,
	"println":     printUnreadable,
	"read-string": readString,
	"slurp":       slurp,

	"list":   createList,
	"list?":  isList,
	"empty?": isEmptyList,
	"count":  getListSize,

	"=":  isEqual,
	"<":  isLess,
	"<=": isLessEqual,
	">":  isGreater,
	">=": isGreaterEqual,
}

NameSpace is the initial namespace for mal

Functions

func AssertLength

func AssertLength(args []types.MalType, expect int) error

AssertLength asserts the length of a list

Types

This section is empty.

Jump to

Keyboard shortcuts

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