stdlib

package
v0.0.0-...-f11db3b Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConstantNames = []string{
	"true",
	"false",
	"pi",
}
View Source
var StandardLibrary uni.Environment = uni.Environment{
	"true":     uni.NewBoolean(true),
	"false":    uni.NewBoolean(false),
	"pi":       uni.NewFloat(3.141592653589793),
	"*":        uni.NewCallableFunction("*", []string{"a", "b"}, SLIB_Multiply),
	"/":        uni.NewCallableFunction("/", []string{"a", "b"}, SLIB_Divide),
	"+":        uni.NewCallableFunction("+", []string{"a", "b"}, SLIB_Add),
	"-":        uni.NewCallableFunction("-", []string{"a", "b"}, SLIB_Subtract),
	"%":        uni.NewCallableFunction("%", []string{"a", "b"}, SLIB_Modulo),
	"concat":   uni.NewCallableFunction("concat", []string{"s1", "s2"}, SLIB_Concatenate),
	"substr":   uni.NewCallableFunction("substr", []string{"str", "start", "end"}, SLIB_Substring),
	"index":    uni.NewCallableFunction("index", []string{"s1", "s2"}, SLIB_Index),
	"length":   uni.NewCallableFunction("length", []string{"str"}, SLIB_Length),
	"upcase":   uni.NewCallableFunction("upcase", []string{"str"}, SLIB_Upcase),
	"downcase": uni.NewCallableFunction("downcase", []string{"str"}, SLIB_Downcase),
	"split":    uni.NewCallableFunction("split", []string{"_str_", "_sep_"}, SLIB_Split),
	"at":       uni.NewCallableFunction("at", []string{"_str_", "_index_"}, SLIB_AtIndex),
	"not":      uni.NewCallableFunction("not", []string{"value"}, SLIB_Negate),
	"zero?":    uni.NewCallableFunction("zero?", []string{"n"}, SLIB_IsZero),
	"and":      uni.NewCallableFunction("and", []string{"b1", "b2"}, SLIB_And),
	"or":       uni.NewCallableFunction("or", []string{"b1", "b2"}, SLIB_Or),
	"=":        uni.NewCallableFunction("=", []string{"a", "b"}, SLIB_Equal),
	">":        uni.NewCallableFunction(">", []string{"a", "b"}, SLIB_GreaterThan),
	"<":        uni.NewCallableFunction("<", []string{"a", "b"}, SLIB_LessThan),
	">=":       uni.NewCallableFunction(">=", []string{"a", "b"}, SLIB_GreaterOrEqual),
	"<=":       uni.NewCallableFunction("<=", []string{"a", "b"}, SLIB_LessOrEqual),
	"list":     uni.NewCallableFunction("list", []string{}, SLIB_List),
	"first":    uni.NewCallableFunction("first", []string{"_list_"}, SLIB_First),
	"tail":     uni.NewCallableFunction("tail", []string{"_list_"}, SLIB_Tail),
	"append":   uni.NewCallableFunction("append", []string{"_list_", "_value_"}, SLIB_Append),
	"size":     uni.NewCallableFunction("size", []string{"_list_"}, SLIB_Size),
	"mapping":  uni.NewCallableFunction("mapping", []string{}, SLIB_Map),
	"assoc":    uni.NewCallableFunction("assoc", []string{"_map_", "_key1_", "_value1_"}, SLIB_Associate),
	"get":      uni.NewCallableFunction("get", []string{"_map_", "_key_"}, SLIB_GetMap),
	"keys":     uni.NewCallableFunction("keys", []string{"_map_"}, SLIB_Keys),
	"print":    uni.NewCallableFunction("print", []string{"msg"}, SLIB_Print),
	"env":      uni.NewCallableFunction("env", []string{"_envvar_"}, SLIB_Environment),
	"ignored":  uni.NewCallableFunction("ignored", []string{"_value_"}, SLIB_Ignore),
}

Functions

func SLIB_Add

func SLIB_Add(arguments ...interface{}) (uni.Value, error)

func SLIB_And

func SLIB_And(arguments ...interface{}) (uni.Value, error)

func SLIB_Append

func SLIB_Append(arguments ...interface{}) (uni.Value, error)

func SLIB_Associate

func SLIB_Associate(arguments ...interface{}) (uni.Value, error)

func SLIB_AtIndex

func SLIB_AtIndex(arguments ...interface{}) (uni.Value, error)

func SLIB_Concatenate

func SLIB_Concatenate(arguments ...interface{}) (uni.Value, error)

func SLIB_Divide

func SLIB_Divide(arguments ...interface{}) (uni.Value, error)

func SLIB_Downcase

func SLIB_Downcase(arguments ...interface{}) (uni.Value, error)

func SLIB_Environment

func SLIB_Environment(arguments ...interface{}) (uni.Value, error)

*

  • Get the value of an environment variable

func SLIB_Equal

func SLIB_Equal(arguments ...interface{}) (uni.Value, error)

func SLIB_First

func SLIB_First(arguments ...interface{}) (uni.Value, error)

func SLIB_GetMap

func SLIB_GetMap(arguments ...interface{}) (uni.Value, error)

func SLIB_GreaterOrEqual

func SLIB_GreaterOrEqual(arguments ...interface{}) (uni.Value, error)

func SLIB_GreaterThan

func SLIB_GreaterThan(arguments ...interface{}) (uni.Value, error)

func SLIB_Ignore

func SLIB_Ignore(arguments ...interface{}) (uni.Value, error)

func SLIB_Index

func SLIB_Index(arguments ...interface{}) (uni.Value, error)

func SLIB_IsZero

func SLIB_IsZero(arguments ...interface{}) (uni.Value, error)

func SLIB_Keys

func SLIB_Keys(arguments ...interface{}) (uni.Value, error)

func SLIB_Length

func SLIB_Length(arguments ...interface{}) (uni.Value, error)

func SLIB_LessOrEqual

func SLIB_LessOrEqual(arguments ...interface{}) (uni.Value, error)

func SLIB_LessThan

func SLIB_LessThan(arguments ...interface{}) (uni.Value, error)

func SLIB_List

func SLIB_List(arguments ...interface{}) (uni.Value, error)

func SLIB_Map

func SLIB_Map(arguments ...interface{}) (uni.Value, error)

func SLIB_Modulo

func SLIB_Modulo(arguments ...interface{}) (uni.Value, error)

func SLIB_Multiply

func SLIB_Multiply(arguments ...interface{}) (uni.Value, error)

func SLIB_Negate

func SLIB_Negate(arguments ...interface{}) (uni.Value, error)

func SLIB_Or

func SLIB_Or(arguments ...interface{}) (uni.Value, error)

func SLIB_Print

func SLIB_Print(arguments ...interface{}) (uni.Value, error)

func SLIB_Size

func SLIB_Size(arguments ...interface{}) (uni.Value, error)

func SLIB_Split

func SLIB_Split(arguments ...interface{}) (uni.Value, error)

func SLIB_Substring

func SLIB_Substring(arguments ...interface{}) (uni.Value, error)

func SLIB_Subtract

func SLIB_Subtract(arguments ...interface{}) (uni.Value, error)

func SLIB_Tail

func SLIB_Tail(arguments ...interface{}) (uni.Value, error)

func SLIB_Upcase

func SLIB_Upcase(arguments ...interface{}) (uni.Value, error)

func ToBoolKeyword

func ToBoolKeyword(value bool) uni.Value

Types

This section is empty.

Jump to

Keyboard shortcuts

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