stdlib

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BytesBufferInterface vida.Namespace

BytesBufferInterface is the collection of methods for the type Bytes.

View Source
var CMDInterface vida.Namespace
View Source
var FileInterface vida.Namespace
View Source
var RegexInterface vida.Namespace
View Source
var Stdlib = map[string]vida.LibLoader{
	"math":          loadMath,
	"random":        loadRandom,
	"time":          loadTime,
	"stringBuilder": loadStringBuilder,
	"bytesBuffer":   loadBytesBuffer,
	"io":            loadIO,
	"fmt":           loadFmt,
	"regex":         loadRegex,
	"cmd":           loadCMD,
}

Stdlib is the map mapping module names to LibLoaders.

View Source
var StringBuilderInterface vida.Namespace

Functions

func GFunctionFromFloatFloatToFloat

func GFunctionFromFloatFloatToFloat(functionName string, fn func(float64, float64) float64) vida.GFunction

GFunctionFromFloatToFloat wraps a Go function type func(float64, float64)float64

func GFunctionFromFloatToFloat

func GFunctionFromFloatToFloat(functionName string, fn func(float64) float64) vida.GFunction

GFunctionFromFloatToFloat wraps a Go function type func(float64)float64

func GFunctionFromIntToInt

func GFunctionFromIntToInt(functionName string, fn func(int64) int64) vida.GFunction

GFunctionFromIntToInt wraps a Go function type func(int64)int64

func GFunctionFromStringToBool

func GFunctionFromStringToBool(functionName string, fn func(string) bool) vida.GFunction

GFunctionFromStringToBool wraps a Go function type func(string)bool

func GFunctionFromVoidToFloat

func GFunctionFromVoidToFloat(functionName string, fn func() float64) vida.GFunction

GFunctionFromVoidToFloat wraps a Go function type func()float64

func GFunctionFromVoidToInt

func GFunctionFromVoidToInt(functionName string, fn func() int64) vida.GFunction

GFunctionFromVoidToInt wraps a Go function type func()int64

func GFunctionFromVoidToString

func GFunctionFromVoidToString(functionName string, fn func() string) vida.GFunction

GFunctionFromVoidToString wraps a Go function type func()string

func GFunctionFromVoidToUInt

func GFunctionFromVoidToUInt(functionName string, fn func() uint64) vida.GFunction

GFunctionFromVoidToUInt wraps a Go function type func()uint64

Types

type BytesBuffer

type BytesBuffer struct {
	Buffer bytes.Buffer
}

BytesBuffer models a bytes buffer with operations to read and write aribitrary bytes.

func (*BytesBuffer) BinaryOp

func (buffer *BytesBuffer) BinaryOp(op byte, rhs vida.Value) (vida.Value, error)

func (*BytesBuffer) Clone

func (buffer *BytesBuffer) Clone() vida.Value

func (*BytesBuffer) Description

func (buffer *BytesBuffer) Description() string

func (*BytesBuffer) Equals

func (buffer *BytesBuffer) Equals(other vida.Value) bool

func (*BytesBuffer) GetMethod

func (buffer *BytesBuffer) GetMethod(name string) (vida.Value, bool, error)

func (*BytesBuffer) HasMethods

func (buffer *BytesBuffer) HasMethods() bool

func (*BytesBuffer) IndexGet

func (buffer *BytesBuffer) IndexGet(index vida.Value) (vida.Value, error)

func (*BytesBuffer) IndexSet

func (buffer *BytesBuffer) IndexSet(index, value vida.Value) error

func (*BytesBuffer) IsHashable

func (buffer *BytesBuffer) IsHashable() bool

func (*BytesBuffer) IsIterable

func (buffer *BytesBuffer) IsIterable() bool

func (*BytesBuffer) IsValueSemantics

func (buffer *BytesBuffer) IsValueSemantics() bool

func (*BytesBuffer) MakeHashKey

func (buffer *BytesBuffer) MakeHashKey() vida.HashKey

func (*BytesBuffer) MakeIterator

func (buffer *BytesBuffer) MakeIterator() vida.Iterator

func (*BytesBuffer) PrefixOp

func (buffer *BytesBuffer) PrefixOp(op byte) (vida.Value, error)

func (*BytesBuffer) TypeName

func (buffer *BytesBuffer) TypeName() string

Interface Value

type Cmd

type Cmd struct {
	Value *exec.Cmd
}

Cmd is a wrapper for Golang *exec.Cmd.

func (Cmd) BinaryOp

func (cmd Cmd) BinaryOp(op byte, rhs vida.Value) (vida.Value, error)

func (Cmd) Clone

func (cmd Cmd) Clone() vida.Value

func (Cmd) Description

func (cmd Cmd) Description() string

func (Cmd) Equals

func (cmd Cmd) Equals(other vida.Value) bool

func (Cmd) GetMethod

func (cmd Cmd) GetMethod(name string) (vida.Value, bool, error)

func (Cmd) HasMethods

func (cmd Cmd) HasMethods() bool

func (Cmd) IsHashable

func (cmd Cmd) IsHashable() bool

func (Cmd) IsIterable

func (cmd Cmd) IsIterable() bool

func (Cmd) IsValueSemantics

func (cmd Cmd) IsValueSemantics() bool

func (Cmd) MakeHashKey

func (cmd Cmd) MakeHashKey() vida.HashKey

func (Cmd) MakeIterator

func (cmd Cmd) MakeIterator() vida.Iterator

func (Cmd) PrefixOp

func (cmd Cmd) PrefixOp(op byte) (vida.Value, error)

func (Cmd) TypeName

func (cmd Cmd) TypeName() string

Interface vida.Value

type Duration

type Duration struct {
	Value time.Duration
}

Durations models Go's Duration type derived from int64

func (Duration) BinaryOp

func (d Duration) BinaryOp(op byte, rhs vida.Value) (vida.Value, error)

func (Duration) Clone

func (d Duration) Clone() vida.Value

func (Duration) Description

func (d Duration) Description() string

func (Duration) Equals

func (d Duration) Equals(other vida.Value) bool

func (Duration) GetMethod

func (d Duration) GetMethod(name string) (vida.Value, bool, error)

func (Duration) HasMethods

func (d Duration) HasMethods() bool

func (Duration) IsHashable

func (d Duration) IsHashable() bool

func (Duration) IsIterable

func (d Duration) IsIterable() bool

func (Duration) IsValueSemantics

func (d Duration) IsValueSemantics() bool

func (Duration) MakeHashKey

func (d Duration) MakeHashKey() vida.HashKey

func (Duration) MakeIterator

func (d Duration) MakeIterator() vida.Iterator

func (Duration) PrefixOp

func (d Duration) PrefixOp(op byte) (vida.Value, error)

func (Duration) TypeName

func (d Duration) TypeName() string

Interface Value

type File

type File struct {
	Value *os.File
}

File models an open file descriptor.

func (*File) BinaryOp

func (file *File) BinaryOp(op byte, rhs vida.Value) (vida.Value, error)

func (*File) Clone

func (file *File) Clone() vida.Value

func (*File) Description

func (file *File) Description() string

func (*File) Equals

func (file *File) Equals(other vida.Value) bool

func (*File) GetMethod

func (file *File) GetMethod(name string) (vida.Value, bool, error)

func (*File) HasMethods

func (file *File) HasMethods() bool

func (*File) IsHashable

func (file *File) IsHashable() bool

func (*File) IsIterable

func (file *File) IsIterable() bool

func (*File) IsValueSemantics

func (file *File) IsValueSemantics() bool

func (*File) MakeHashKey

func (file *File) MakeHashKey() vida.HashKey

func (*File) MakeIterator

func (file *File) MakeIterator() vida.Iterator

func (*File) PrefixOp

func (file *File) PrefixOp(op byte) (vida.Value, error)

func (*File) TypeName

func (file *File) TypeName() string

Value Interface

type Month

type Month struct {
	Value time.Month
}

Month models weekdays.

func (Month) BinaryOp

func (m Month) BinaryOp(op byte, rhs vida.Value) (vida.Value, error)

func (Month) Clone

func (m Month) Clone() vida.Value

func (Month) Description

func (m Month) Description() string

func (Month) Equals

func (m Month) Equals(other vida.Value) bool

func (Month) GetMethod

func (m Month) GetMethod(name string) (vida.Value, bool, error)

func (Month) HasMethods

func (m Month) HasMethods() bool

func (Month) IsHashable

func (m Month) IsHashable() bool

func (Month) IsIterable

func (m Month) IsIterable() bool

func (Month) IsValueSemantics

func (m Month) IsValueSemantics() bool

func (Month) MakeHashKey

func (m Month) MakeHashKey() vida.HashKey

func (Month) MakeIterator

func (m Month) MakeIterator() vida.Iterator

func (Month) PrefixOp

func (m Month) PrefixOp(op byte) (vida.Value, error)

func (Month) TypeName

func (m Month) TypeName() string

Interface vida.Value

type Regex

type Regex struct {
	Value *regexp.Regexp
}

func (*Regex) BinaryOp

func (re *Regex) BinaryOp(op byte, rhs vida.Value) (vida.Value, error)

func (*Regex) Clone

func (re *Regex) Clone() vida.Value

func (*Regex) Description

func (re *Regex) Description() string

func (*Regex) Equals

func (re *Regex) Equals(other vida.Value) bool

func (*Regex) GetMethod

func (re *Regex) GetMethod(name string) (vida.Value, bool, error)

func (*Regex) HasMethods

func (re *Regex) HasMethods() bool

func (*Regex) IsHashable

func (re *Regex) IsHashable() bool

func (*Regex) IsIterable

func (re *Regex) IsIterable() bool

func (*Regex) IsValueSemantics

func (re *Regex) IsValueSemantics() bool

func (*Regex) MakeHashKey

func (re *Regex) MakeHashKey() vida.HashKey

func (*Regex) MakeIterator

func (re *Regex) MakeIterator() vida.Iterator

func (*Regex) PrefixOp

func (re *Regex) PrefixOp(op byte) (vida.Value, error)

func (*Regex) TypeName

func (re *Regex) TypeName() string

Interface vida.Value

type StringBuilder

type StringBuilder struct {
	Builder strings.Builder
}

StringBuilder models an efficient way to build Strings.

func (*StringBuilder) BinaryOp

func (builder *StringBuilder) BinaryOp(op byte, rhs vida.Value) (vida.Value, error)

func (*StringBuilder) Clone

func (builder *StringBuilder) Clone() vida.Value

func (*StringBuilder) Description

func (builder *StringBuilder) Description() string

func (*StringBuilder) Equals

func (builder *StringBuilder) Equals(other vida.Value) bool

func (*StringBuilder) GetMethod

func (builder *StringBuilder) GetMethod(name string) (vida.Value, bool, error)

func (*StringBuilder) HasMethods

func (builder *StringBuilder) HasMethods() bool

func (*StringBuilder) IsHashable

func (builder *StringBuilder) IsHashable() bool

func (*StringBuilder) IsIterable

func (builder *StringBuilder) IsIterable() bool

func (*StringBuilder) IsValueSemantics

func (builder *StringBuilder) IsValueSemantics() bool

func (*StringBuilder) MakeHashKey

func (builder *StringBuilder) MakeHashKey() vida.HashKey

func (*StringBuilder) MakeIterator

func (builder *StringBuilder) MakeIterator() vida.Iterator

func (*StringBuilder) PrefixOp

func (builder *StringBuilder) PrefixOp(op byte) (vida.Value, error)

func (*StringBuilder) TypeName

func (builder *StringBuilder) TypeName() string

Interface Value

type Time

type Time struct {
	Value time.Time
}

Time models Go's Time struct for wall and monotonic clock.

func (Time) BinaryOp

func (t Time) BinaryOp(op byte, rhs vida.Value) (vida.Value, error)

func (Time) Clone

func (t Time) Clone() vida.Value

func (Time) Description

func (t Time) Description() string

func (Time) Equals

func (t Time) Equals(other vida.Value) bool

func (Time) GetMethod

func (t Time) GetMethod(name string) (vida.Value, bool, error)

func (Time) HasMethods

func (t Time) HasMethods() bool

func (Time) IsHashable

func (t Time) IsHashable() bool

func (Time) IsIterable

func (t Time) IsIterable() bool

func (Time) IsValueSemantics

func (t Time) IsValueSemantics() bool

func (Time) MakeHashKey

func (t Time) MakeHashKey() vida.HashKey

func (Time) MakeIterator

func (t Time) MakeIterator() vida.Iterator

func (Time) PrefixOp

func (t Time) PrefixOp(op byte) (vida.Value, error)

func (Time) TypeName

func (t Time) TypeName() string

Interface Value

type WeekDay

type WeekDay struct {
	Value time.Weekday
}

WeekDay models weekdays.

func (WeekDay) BinaryOp

func (day WeekDay) BinaryOp(op byte, rhs vida.Value) (vida.Value, error)

func (WeekDay) Clone

func (day WeekDay) Clone() vida.Value

func (WeekDay) Description

func (day WeekDay) Description() string

func (WeekDay) Equals

func (day WeekDay) Equals(other vida.Value) bool

func (WeekDay) GetMethod

func (day WeekDay) GetMethod(name string) (vida.Value, bool, error)

func (WeekDay) HasMethods

func (day WeekDay) HasMethods() bool

func (WeekDay) IsHashable

func (day WeekDay) IsHashable() bool

func (WeekDay) IsIterable

func (day WeekDay) IsIterable() bool

func (WeekDay) IsValueSemantics

func (day WeekDay) IsValueSemantics() bool

func (WeekDay) MakeHashKey

func (day WeekDay) MakeHashKey() vida.HashKey

func (WeekDay) MakeIterator

func (day WeekDay) MakeIterator() vida.Iterator

func (WeekDay) PrefixOp

func (day WeekDay) PrefixOp(op byte) (vida.Value, error)

func (WeekDay) TypeName

func (day WeekDay) TypeName() string

Interface vida.Value

Jump to

Keyboard shortcuts

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