datum

package
v0.0.0-...-fcffdc5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Elements

func Elements(list types.Value) []types.Value

func ElementsAsRefs

func ElementsAsRefs(list types.Value) []*types.Ref

func ElementsAsType

func ElementsAsType(slice interface{}, list types.Value) interface{}

slice should be an empty slice of the type we want for the output.

func ElementsDatums

func ElementsDatums(list types.Value) []*types.Datum

func NewDatumData

func NewDatumData(src *types.Datum, _ *DatumData, _ ...types.Value)

func NewList

func NewList(initial ...types.Value) types.Value

func NewListFromRefs

func NewListFromRefs(initial ...*types.Ref) types.Value

func NewListFromSlice

func NewListFromSlice(initial interface{}) types.Value

func ToValueSlice

func ToValueSlice(initial interface{}) []types.Value

converts from []<value> to []types.Value

Types

type ConcreteList

type ConcreteList struct {
	Contents []*types.Ref
}

func (*ConcreteList) Append

func (c *ConcreteList) Append(v *types.Ref)

func (*ConcreteList) Get

func (c *ConcreteList) Get(i int) *types.Ref

func (*ConcreteList) Length

func (c *ConcreteList) Length() int

func (*ConcreteList) RemoveIndex

func (c *ConcreteList) RemoveIndex(i int)

func (*ConcreteList) RemoveLast

func (c *ConcreteList) RemoveLast()

func (*ConcreteList) Set

func (c *ConcreteList) Set(i int, v *types.Ref)

type DatumData

type DatumData struct{}

func (*DatumData) ProcNew

func (d *DatumData) ProcNew(src *types.Datum, usr *types.Datum) types.Value

type List

type List struct {
	ListProvider
}

func (List) Invoke

func (l List) Invoke(usr *types.Datum, name string, parameters ...types.Value) types.Value

func (List) SetVar

func (l List) SetVar(name string, value types.Value)

func (List) String

func (l List) String() string

func (List) Var

func (l List) Var(name string) types.Value

type ListProvider

type ListProvider interface {
	Length() int
	Get(i int) *types.Ref
	Set(i int, v *types.Ref)
	Append(v *types.Ref)
	RemoveLast()
	RemoveIndex(i int)
}

Jump to

Keyboard shortcuts

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