env

package
v0.0.20 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 12

Documentation

Overview

object.go

series.go

Index

Constants

This section is empty.

Variables

View Source
var NativeTypes = [...]string{
	"Block",
	"Integer",
	"Word",
	"Setword",
	"Opword",
	"Pipeword",
	"Builtin",
	"Function",
	"Error",
	"Comma",
	"Void",
	"String",
	"Tagword",
	"Genword",
	"Getword",
	"Argword",
	"Native",
	"Uri",
	"LSetword",
	"Ctx",
	"Dict",
	"List",
	"Date",
	"CPath",
	"Xword",
	"EXword",
	"Spreadsheet",
	"Email",
	"Kind",
	"Kindword",
	"Converter",
	"Time",
	"SpreadsheetRowType",
	"Decimal",
	"Vector",
	"OpCPath",
	"PipeCPath",
	"Modword",
	"LModword",
}

Functions

func ArrayFloat32FromSeries

func ArrayFloat32FromSeries(block TSeries) []float32

func LeftPad

func LeftPad(s string, padStr string, padCount int) string

func RyeToRaw

func RyeToRaw(res Object) any

func SetValue

func SetValue(ps *ProgramState, word string, val Object)

Types

type Argword

type Argword struct {
	Name Word
	Kind Word
}

func NewArgword

func NewArgword(name Word, kind Word) *Argword

func (Argword) Dump added in v0.0.13

func (i Argword) Dump(e Idxs) string

func (Argword) Equal added in v0.0.11

func (i Argword) Equal(o Object) bool

func (Argword) GetKind

func (i Argword) GetKind() int

func (Argword) Inspect

func (i Argword) Inspect(e Idxs) string

func (Argword) Print added in v0.0.13

func (b Argword) Print(e Idxs) string

func (Argword) Trace

func (i Argword) Trace(msg string)

func (Argword) Type

func (i Argword) Type() Type

type Block

type Block struct {
	Series TSeries `bson:"series"`
	Mode   int     `bson:"mode"`
}

func NewBlock

func NewBlock(series TSeries) *Block

func NewBlock2

func NewBlock2(series TSeries, m int) *Block

func (Block) Dump added in v0.0.13

func (i Block) Dump(e Idxs) string

func (Block) Equal added in v0.0.11

func (i Block) Equal(o Object) bool

func (Block) GetKind

func (i Block) GetKind() int

func (Block) Inspect

func (b Block) Inspect(e Idxs) string

func (Block) Print added in v0.0.13

func (b Block) Print(e Idxs) string

func (Block) Trace

func (i Block) Trace(msg string)

func (Block) Type

func (i Block) Type() Type

type Builtin

type Builtin struct {
	Fn            BuiltinFunction
	Argsn         int
	Cur0          Object
	Cur1          Object
	Cur2          Object
	Cur3          Object
	Cur4          Object
	AcceptFailure bool
	Pure          bool
	Doc           string
}

Builtin represents a builtin function. TODO: Builtin is just temporary ... we need to make something else, that holds natives and user functions. Interface should be the same ... would it be better (faster) to have concrete type probably.

func NewBuiltin

func NewBuiltin(fn BuiltinFunction, argsn int, acceptFailure bool, pure bool, doc string) *Builtin

func (Builtin) Dump added in v0.0.13

func (i Builtin) Dump(e Idxs) string

func (Builtin) Equal added in v0.0.11

func (i Builtin) Equal(o Object) bool

func (Builtin) GetKind

func (i Builtin) GetKind() int

func (Builtin) Inspect

func (b Builtin) Inspect(e Idxs) string

func (Builtin) Print added in v0.0.13

func (b Builtin) Print(e Idxs) string

func (Builtin) Trace

func (i Builtin) Trace(msg string)

func (Builtin) Type

func (b Builtin) Type() Type

type BuiltinFunction

type BuiltinFunction func(ps *ProgramState, arg0 Object, arg1 Object, arg2 Object, arg3 Object, arg4 Object) Object

BuiltinFunction represents a function signature of builtin functions. ///type BuiltinFunction func(ps *ProgramState, args ...Object) Object

type CPath

type CPath struct {
	Mode  int // 0 Cpath, 1 OpCpath , 2 PipeCPath
	Cnt   int
	Word1 Word
	Word2 Word
	Word3 Word
}

func NewCPath2

func NewCPath2(mode int, w1 Word, w2 Word) *CPath

func NewCPath3

func NewCPath3(mode int, w1 Word, w2 Word, w3 Word) *CPath

func (CPath) Dump added in v0.0.13

func (i CPath) Dump(e Idxs) string

func (CPath) Equal added in v0.0.11

func (i CPath) Equal(o Object) bool

func (CPath) GetKind

func (i CPath) GetKind() int

func (CPath) GetWordNumber

func (o CPath) GetWordNumber(i int) Word

func (CPath) Inspect

func (i CPath) Inspect(e Idxs) string

func (CPath) Print added in v0.0.13

func (b CPath) Print(e Idxs) string

func (CPath) Trace

func (i CPath) Trace(msg string)

func (CPath) Type

func (i CPath) Type() Type

type Comma

type Comma struct{}

func (Comma) Dump added in v0.0.13

func (i Comma) Dump(e Idxs) string

func (Comma) Equal added in v0.0.11

func (i Comma) Equal(o Object) bool

func (Comma) GetKind

func (i Comma) GetKind() int

func (Comma) Inspect

func (i Comma) Inspect(e Idxs) string

func (Comma) Print added in v0.0.13

func (b Comma) Print(e Idxs) string

func (Comma) Trace

func (i Comma) Trace(msg string)

func (Comma) Type

func (i Comma) Type() Type

type Converter

type Converter struct {
	From Word
	To   Word
	Spec Block
}

func NewConverter

func NewConverter(from Word, to Word, spec Block) *Converter

func (Converter) Dump added in v0.0.13

func (i Converter) Dump(e Idxs) string

func (Converter) Equal added in v0.0.11

func (i Converter) Equal(o Object) bool

func (Converter) GetKind

func (i Converter) GetKind() int

func (Converter) Inspect

func (i Converter) Inspect(e Idxs) string

func (Converter) Print added in v0.0.13

func (i Converter) Print(e Idxs) string

func (Converter) Trace

func (i Converter) Trace(msg string)

func (Converter) Type

func (i Converter) Type() Type

type Date

type Date struct {
	Value time.Time
}

func NewDate

func NewDate(val time.Time) *Date

func (Date) Dump added in v0.0.13

func (i Date) Dump(e Idxs) string

func (Date) Equal added in v0.0.11

func (i Date) Equal(o Object) bool

func (Date) GetKind

func (i Date) GetKind() int

func (Date) Inspect

func (i Date) Inspect(e Idxs) string

func (Date) Print added in v0.0.13

func (i Date) Print(e Idxs) string

func (Date) Trace

func (i Date) Trace(msg string)

func (Date) Type

func (i Date) Type() Type

type Decimal

type Decimal struct {
	Value float64 `bson:"value"`
}

func NewDecimal

func NewDecimal(val float64) *Decimal

func (Decimal) Dump added in v0.0.13

func (i Decimal) Dump(e Idxs) string

func (Decimal) Equal added in v0.0.11

func (i Decimal) Equal(o Object) bool

func (Decimal) GetKind

func (i Decimal) GetKind() int

func (Decimal) Inspect

func (i Decimal) Inspect(e Idxs) string

func (Decimal) Print added in v0.0.13

func (i Decimal) Print(e Idxs) string

func (Decimal) Trace

func (i Decimal) Trace(msg string)

func (Decimal) Type

func (i Decimal) Type() Type

type Dict

type Dict struct {
	Data map[string]any
	Kind Word
}

Dict -- nonindexed and unboxed map ... for example for params from request etc, so we don't neet to idex keys and it doesn't need boxed values I think it should have option of having Kind too ...

func NewDict

func NewDict(data map[string]any) *Dict

func NewDictFromSeries

func NewDictFromSeries(block TSeries, idx *Idxs) Dict

func (Dict) Dump added in v0.0.13

func (i Dict) Dump(e Idxs) string

func (Dict) Equal added in v0.0.11

func (i Dict) Equal(o Object) bool

func (Dict) GetKind

func (i Dict) GetKind() int

func (Dict) Inspect

func (i Dict) Inspect(idxs Idxs) string

func (Dict) Print added in v0.0.13

func (i Dict) Print(idxs Idxs) string

func (Dict) Trace

func (i Dict) Trace(msg string)

func (Dict) Type

func (i Dict) Type() Type

type EXword

type EXword struct {
	Index int
}

func NewEXword

func NewEXword(index int) *EXword

func (EXword) Dump added in v0.0.13

func (i EXword) Dump(e Idxs) string

func (EXword) Equal added in v0.0.11

func (i EXword) Equal(o Object) bool

func (EXword) GetKind

func (i EXword) GetKind() int

func (EXword) Inspect

func (i EXword) Inspect(e Idxs) string

func (EXword) Print added in v0.0.13

func (b EXword) Print(e Idxs) string

func (EXword) ToWord

func (i EXword) ToWord() Word

func (EXword) Trace

func (i EXword) Trace(msg string)

func (EXword) Type

func (i EXword) Type() Type

type Email

type Email struct {
	Address string
}

func NewEmail

func NewEmail(address string) *Email

func (Email) Dump added in v0.0.13

func (i Email) Dump(e Idxs) string

func (Email) Equal added in v0.0.11

func (i Email) Equal(o Object) bool

func (Email) GetKind

func (i Email) GetKind() int

func (Email) Inspect

func (i Email) Inspect(e Idxs) string

func (Email) Print added in v0.0.13

func (i Email) Print(e Idxs) string

func (Email) Trace

func (i Email) Trace(msg string)

func (Email) Type

func (i Email) Type() Type

type EnvR2

type EnvR2 struct {
	Var1 Object
	Var2 Object
	// contains filtered or unexported fields
}

type Error

type Error struct {
	Status      int
	Message     string
	Parent      *Error
	Values      map[string]Object
	CodeContext *RyeCtx
	CodeBlock   TSeries
}

func NewError

func NewError(message string) *Error

func NewError1

func NewError1(status int) *Error

func NewError2

func NewError2(status int, message string) *Error

func NewError4

func NewError4(status int, message string, error *Error, values map[string]Object) *Error

func (Error) Dump added in v0.0.13

func (i Error) Dump(e Idxs) string

func (Error) Equal added in v0.0.11

func (i Error) Equal(o Object) bool

func (Error) GetKind

func (i Error) GetKind() int

func (Error) Inspect

func (i Error) Inspect(e Idxs) string

func (Error) Print added in v0.0.13

func (i Error) Print(e Idxs) string

func (Error) Trace

func (i Error) Trace(msg string)

func (Error) Type

func (i Error) Type() Type

type Function

type Function struct {
	Argsn int
	Spec  Block
	Body  Block
	Ctx   *RyeCtx
	Pure  bool
	Doc   string
	InCtx bool
}

func NewFunction

func NewFunction(spec Block, body Block, pure bool) *Function

func NewFunctionC

func NewFunctionC(spec Block, body Block, ctx *RyeCtx, pure bool, inCtx bool, doc string) *Function

func NewFunctionDoc

func NewFunctionDoc(spec Block, body Block, pure bool, doc string) *Function

func (Function) Dump

func (i Function) Dump(e Idxs) string

func (Function) Equal added in v0.0.11

func (i Function) Equal(o Object) bool

func (Function) GetKind

func (i Function) GetKind() int

func (Function) Inspect

func (i Function) Inspect(e Idxs) string

func (Function) Print added in v0.0.13

func (i Function) Print(e Idxs) string

func (Function) Trace

func (i Function) Trace(msg string)

func (Function) Type

func (i Function) Type() Type

type Gen

type Gen struct {
	// contains filtered or unexported fields
}

func NewGen

func NewGen() *Gen

func (*Gen) Get

func (e *Gen) Get(kind int, word int) (Object, bool)

func (*Gen) Print added in v0.0.13

func (e *Gen) Print(idxs Idxs)

func (*Gen) Set

func (e *Gen) Set(kind int, word int, val Object) Object

type Genword

type Genword struct {
	Index int
}

func NewGenword

func NewGenword(index int) *Genword

func (Genword) Dump added in v0.0.13

func (i Genword) Dump(e Idxs) string

func (Genword) Equal added in v0.0.11

func (i Genword) Equal(o Object) bool

func (Genword) GetKind

func (i Genword) GetKind() int

func (Genword) Inspect

func (i Genword) Inspect(e Idxs) string

func (Genword) Print added in v0.0.13

func (b Genword) Print(e Idxs) string

func (Genword) ToWord

func (i Genword) ToWord() Word

func (Genword) Trace

func (i Genword) Trace(msg string)

func (Genword) Type

func (i Genword) Type() Type

type Getword

type Getword struct {
	Index int
}

func NewGetword

func NewGetword(index int) *Getword

func (Getword) Dump added in v0.0.13

func (i Getword) Dump(e Idxs) string

func (Getword) Equal added in v0.0.11

func (i Getword) Equal(o Object) bool

func (Getword) GetKind

func (i Getword) GetKind() int

func (Getword) Inspect

func (i Getword) Inspect(e Idxs) string

func (Getword) Print added in v0.0.13

func (b Getword) Print(e Idxs) string

func (Getword) ToWord

func (i Getword) ToWord() Word

func (Getword) Trace

func (i Getword) Trace(msg string)

func (Getword) Type

func (i Getword) Type() Type

type Idxs

type Idxs struct {
	// contains filtered or unexported fields
}

func NewIdxs

func NewIdxs() *Idxs

func (*Idxs) GetIndex

func (e *Idxs) GetIndex(w string) (int, bool)

func (Idxs) GetWord

func (e Idxs) GetWord(i int) string

func (Idxs) GetWordCount

func (e Idxs) GetWordCount() int

func (*Idxs) IndexWord

func (e *Idxs) IndexWord(w string) int

func (Idxs) Print added in v0.0.13

func (e Idxs) Print()

type Integer

type Integer struct {
	Value int64
}

func NewInteger

func NewInteger(val int64) *Integer

func (Integer) Dump added in v0.0.13

func (i Integer) Dump(e Idxs) string

func (Integer) Equal added in v0.0.11

func (i Integer) Equal(o Object) bool

func (Integer) GetKind

func (i Integer) GetKind() int

func (Integer) Inspect

func (i Integer) Inspect(e Idxs) string

func (Integer) Print added in v0.0.13

func (i Integer) Print(e Idxs) string

func (Integer) Trace

func (i Integer) Trace(msg string)

func (Integer) Type

func (i Integer) Type() Type

type Kind

type Kind struct {
	Kind       Word
	Spec       Block
	Converters map[int]Block
}

func NewKind

func NewKind(kind Word, spec Block) *Kind

func (Kind) Dump added in v0.0.13

func (i Kind) Dump(e Idxs) string

func (Kind) Equal added in v0.0.11

func (i Kind) Equal(o Object) bool

func (Kind) GetKind

func (i Kind) GetKind() int

func (Kind) HasConverter

func (i Kind) HasConverter(from int) bool

func (Kind) Inspect

func (i Kind) Inspect(e Idxs) string

func (Kind) Print added in v0.0.13

func (i Kind) Print(e Idxs) string

func (Kind) SetConverter

func (i Kind) SetConverter(from int, spec Block)

func (Kind) Trace

func (i Kind) Trace(msg string)

func (Kind) Type

func (i Kind) Type() Type

type Kindword

type Kindword struct {
	Index int
}

func NewKindword

func NewKindword(index int) *Kindword

func (Kindword) Dump added in v0.0.13

func (i Kindword) Dump(e Idxs) string

func (Kindword) Equal added in v0.0.11

func (i Kindword) Equal(o Object) bool

func (Kindword) GetKind

func (i Kindword) GetKind() int

func (Kindword) Inspect

func (i Kindword) Inspect(e Idxs) string

func (Kindword) Print added in v0.0.13

func (b Kindword) Print(e Idxs) string

func (Kindword) ToWord

func (i Kindword) ToWord() Word

func (Kindword) Trace

func (i Kindword) Trace(msg string)

func (Kindword) Type

func (i Kindword) Type() Type

type LModword added in v0.0.20

type LModword struct {
	Index int
}

func NewLModword added in v0.0.20

func NewLModword(index int) *LModword

func (LModword) Dump added in v0.0.20

func (i LModword) Dump(e Idxs) string

func (LModword) Equal added in v0.0.20

func (i LModword) Equal(o Object) bool

func (LModword) GetKind added in v0.0.20

func (i LModword) GetKind() int

func (LModword) Inspect added in v0.0.20

func (i LModword) Inspect(e Idxs) string

func (LModword) Print added in v0.0.20

func (b LModword) Print(e Idxs) string

func (LModword) Trace added in v0.0.20

func (i LModword) Trace(msg string)

func (LModword) Type added in v0.0.20

func (i LModword) Type() Type

type LSetword

type LSetword struct {
	Index int
}

func NewLSetword

func NewLSetword(index int) *LSetword

func (LSetword) Dump added in v0.0.13

func (i LSetword) Dump(e Idxs) string

func (LSetword) Equal added in v0.0.11

func (i LSetword) Equal(o Object) bool

func (LSetword) GetKind

func (i LSetword) GetKind() int

func (LSetword) Inspect

func (i LSetword) Inspect(e Idxs) string

func (LSetword) Print added in v0.0.13

func (b LSetword) Print(e Idxs) string

func (LSetword) Trace

func (i LSetword) Trace(msg string)

func (LSetword) Type

func (i LSetword) Type() Type

type List

type List struct {
	Data []any
	Kind Word
}

List -- nonindexed and unboxed list (block)

func NewList

func NewList(data []any) *List

func NewListFromSeries

func NewListFromSeries(block TSeries) List

func (List) Dump added in v0.0.13

func (i List) Dump(e Idxs) string

func (List) Equal added in v0.0.11

func (i List) Equal(o Object) bool

func (List) GetKind

func (i List) GetKind() int

func (List) Inspect

func (i List) Inspect(idxs Idxs) string

func (List) Print added in v0.0.13

func (i List) Print(idxs Idxs) string

func (List) Trace

func (i List) Trace(msg string)

func (List) Type

func (i List) Type() Type

type LiveEnv added in v0.0.20

type LiveEnv struct {
	Active  bool
	Watcher *fsnotify.Watcher
	PsMutex sync.Mutex
	Updates []string
}

func NewLiveEnv added in v0.0.20

func NewLiveEnv() *LiveEnv

func (*LiveEnv) Add added in v0.0.20

func (le *LiveEnv) Add(file string)

func (*LiveEnv) ClearUpdates added in v0.0.20

func (le *LiveEnv) ClearUpdates()

type Modword added in v0.0.20

type Modword struct {
	Index int
}

func NewModword added in v0.0.20

func NewModword(index int) *Modword

func (Modword) Dump added in v0.0.20

func (i Modword) Dump(e Idxs) string

func (Modword) Equal added in v0.0.20

func (i Modword) Equal(o Object) bool

func (Modword) GetKind added in v0.0.20

func (i Modword) GetKind() int

func (Modword) Inspect added in v0.0.20

func (i Modword) Inspect(e Idxs) string

func (Modword) Print added in v0.0.20

func (b Modword) Print(e Idxs) string

func (Modword) Trace added in v0.0.20

func (i Modword) Trace(msg string)

func (Modword) Type added in v0.0.20

func (i Modword) Type() Type

type Native

type Native struct {
	Value any
	Kind  Word
}

func NewNative

func NewNative(index *Idxs, val any, kind string) *Native

func (Native) Dump added in v0.0.13

func (i Native) Dump(e Idxs) string

func (Native) Equal added in v0.0.11

func (i Native) Equal(o Object) bool

func (Native) GetKind

func (i Native) GetKind() int

func (Native) Inspect

func (i Native) Inspect(e Idxs) string

func (Native) Print added in v0.0.13

func (i Native) Print(e Idxs) string

func (Native) Trace

func (i Native) Trace(msg string)

func (Native) Type

func (i Native) Type() Type

type Object

type Object interface {
	Type() Type
	Trace(msg string)
	GetKind() int
	Equal(p Object) bool
	// Print returns a string representation of the Object.
	Print(e Idxs) string
	// Inspect returns a diagnostic string representation of the Object.
	Inspect(e Idxs) string
	// Dump returns a string representation of the Object, intended for serialization.
	Dump(e Idxs) string
}

func ToRyeValue

func ToRyeValue(val any) Object

type Opword

type Opword struct {
	Index int
	Force int
}

func NewOpword

func NewOpword(index, force int) *Opword

func (Opword) Dump added in v0.0.13

func (i Opword) Dump(e Idxs) string

func (Opword) Equal added in v0.0.11

func (i Opword) Equal(o Object) bool

func (Opword) GetKind

func (i Opword) GetKind() int

func (Opword) Inspect

func (i Opword) Inspect(e Idxs) string

func (Opword) Print added in v0.0.13

func (b Opword) Print(e Idxs) string

func (Opword) ToWord

func (i Opword) ToWord() Word

func (Opword) Trace

func (i Opword) Trace(msg string)

func (Opword) Type

func (i Opword) Type() Type

type Pipeword

type Pipeword struct {
	Index int
	Force int
}

func NewPipeword

func NewPipeword(index, force int) *Pipeword

func (Pipeword) Dump added in v0.0.13

func (i Pipeword) Dump(e Idxs) string

func (Pipeword) Equal added in v0.0.11

func (i Pipeword) Equal(o Object) bool

func (Pipeword) GetKind

func (i Pipeword) GetKind() int

func (Pipeword) Inspect

func (i Pipeword) Inspect(e Idxs) string

func (Pipeword) Print added in v0.0.13

func (b Pipeword) Print(e Idxs) string

func (Pipeword) ToWord

func (i Pipeword) ToWord() Word

func (Pipeword) Trace

func (i Pipeword) Trace(msg string)

func (Pipeword) Type

func (i Pipeword) Type() Type

type ProgramState

type ProgramState struct {
	Ser          TSeries // current block of code
	Res          Object  // result of expression
	Ctx          *RyeCtx // Env object ()
	PCtx         *RyeCtx // Env object () -- pure countext
	Idx          *Idxs   // Idx object (index of words)
	Args         []int   // names of current arguments (indexes of names)
	Gen          *Gen    // map[int]map[int]Object  // list of Generic kinds / code
	Inj          Object  // Injected first value in a block evaluation
	Injnow       bool
	ReturnFlag   bool
	ErrorFlag    bool
	FailureFlag  bool
	ForcedResult Object
	SkipFlag     bool
	InErrHandler bool
	ScriptPath   string // holds the path to the script that is being imported (doed) currently
	WorkingPath  string // holds the path to CWD (can be changed in program with specific functions)
	AllowMod     bool
	LiveObj      *LiveEnv
}

func AddToProgramState

func AddToProgramState(ps *ProgramState, ser TSeries, idx *Idxs) *ProgramState

func NewProgramState

func NewProgramState(ser TSeries, idx *Idxs) *ProgramState

func NewProgramStateNEW added in v0.0.15

func NewProgramStateNEW() *ProgramState

func (*ProgramState) Dump added in v0.0.13

func (ps *ProgramState) Dump() string

type RyeCtx

type RyeCtx struct {
	Parent *RyeCtx
	Kind   Word
	Doc    string
	// contains filtered or unexported fields
}

func NewEnv

func NewEnv(par *RyeCtx) *RyeCtx

func NewEnv2

func NewEnv2(par *RyeCtx, doc string) *RyeCtx

func (RyeCtx) Copy

func (e RyeCtx) Copy() *RyeCtx

func (RyeCtx) Dump added in v0.0.13

func (i RyeCtx) Dump(e Idxs) string

func (RyeCtx) DumpBare added in v0.0.16

func (i RyeCtx) DumpBare(e Idxs) string

DumpBare returns the string representation of the context without wraping it in context { ... }

func (RyeCtx) Equal added in v0.0.11

func (i RyeCtx) Equal(o Object) bool

func (*RyeCtx) Get

func (e *RyeCtx) Get(word int) (Object, bool)

func (*RyeCtx) Get2

func (e *RyeCtx) Get2(word int) (Object, bool, *RyeCtx)

func (RyeCtx) GetKind

func (i RyeCtx) GetKind() int

func (RyeCtx) GetWords

func (e RyeCtx) GetWords(idxs Idxs) Block

func (RyeCtx) Inspect

func (i RyeCtx) Inspect(e Idxs) string

Inspect returns a string representation of the Integer.

func (*RyeCtx) Mod added in v0.0.20

func (e *RyeCtx) Mod(word int, val Object) bool

func (RyeCtx) Preview

func (e RyeCtx) Preview(idxs Idxs, filter string) string

func (RyeCtx) Print added in v0.0.13

func (e RyeCtx) Print(idxs Idxs) string

func (*RyeCtx) Set

func (e *RyeCtx) Set(word int, val Object) Object

func (*RyeCtx) SetNew added in v0.0.20

func (e *RyeCtx) SetNew(word int, val Object, idxs *Idxs) bool

func (RyeCtx) Trace

func (i RyeCtx) Trace(msg string)

func (RyeCtx) Type

func (i RyeCtx) Type() Type

Type returns the type of the Integer.

func (*RyeCtx) Unset added in v0.0.20

func (e *RyeCtx) Unset(word int, idxs *Idxs) Object

type Setword

type Setword struct {
	Index int
}

func NewSetword

func NewSetword(index int) *Setword

func (Setword) Dump added in v0.0.13

func (i Setword) Dump(e Idxs) string

func (Setword) Equal added in v0.0.11

func (i Setword) Equal(o Object) bool

func (Setword) GetKind

func (i Setword) GetKind() int

func (Setword) Inspect

func (i Setword) Inspect(e Idxs) string

func (Setword) Print added in v0.0.13

func (b Setword) Print(e Idxs) string

func (Setword) Trace

func (i Setword) Trace(msg string)

func (Setword) Type

func (i Setword) Type() Type

type SprNode

type SprNode struct {
	Value    Object
	Children []*SprNode
	Depth    int
	Parent   *SprNode
}

func NewSprNode

func NewSprNode(value Object, depth int, parent *SprNode) *SprNode

func (SprNode) FindChild

func (n SprNode) FindChild(idx int) *SprNode

func (SprNode) Print added in v0.0.13

func (n SprNode) Print(depth int, idxs Idxs)

type Spreadsheet

type Spreadsheet struct {
	Cols    []string
	Rows    []SpreadsheetRow
	Kind    Word
	Indexes map[string]map[any][]int
}

func NewSpreadsheet

func NewSpreadsheet(cols []string) *Spreadsheet

func (*Spreadsheet) AddRow

func (s *Spreadsheet) AddRow(vals SpreadsheetRow)

Inspect returns a string representation of the Integer.

func (Spreadsheet) Column

func (s Spreadsheet) Column(name string) Object

func (Spreadsheet) Columns

func (s Spreadsheet) Columns(ps *ProgramState, names []string) Object

func (Spreadsheet) Dump added in v0.0.13

func (s Spreadsheet) Dump(e Idxs) string

func (Spreadsheet) Equal added in v0.0.11

func (s Spreadsheet) Equal(o Object) bool

func (Spreadsheet) GetColumns

func (s Spreadsheet) GetColumns() List

func (Spreadsheet) GetKind

func (s Spreadsheet) GetKind() int

func (Spreadsheet) GetRow

func (s Spreadsheet) GetRow(ps *ProgramState, index int) SpreadsheetRow

func (Spreadsheet) GetRowNew

func (s Spreadsheet) GetRowNew(index int) Object

func (Spreadsheet) GetRowValue

func (s Spreadsheet) GetRowValue(column string, rrow SpreadsheetRow) (any, error)

func (*Spreadsheet) GetRows

func (s *Spreadsheet) GetRows() []SpreadsheetRow

func (Spreadsheet) Inspect

func (s Spreadsheet) Inspect(e Idxs) string

Inspect returns a string

func (Spreadsheet) NRows

func (s Spreadsheet) NRows() int

func (Spreadsheet) Print added in v0.0.13

func (s Spreadsheet) Print(e Idxs) string

Inspect returns a string representation of the Integer.

func (*Spreadsheet) SetCols

func (s *Spreadsheet) SetCols(vals []string)

Inspect returns a string representation of the Integer.

func (Spreadsheet) Sum

func (s Spreadsheet) Sum(name string) Object

func (Spreadsheet) Sum_Just

func (s Spreadsheet) Sum_Just(name string) (float64, error)

func (Spreadsheet) ToHtml

func (s Spreadsheet) ToHtml() string

Inspect returns a string representation of the Integer.

func (Spreadsheet) ToTxt

func (s Spreadsheet) ToTxt() string

Inspect returns a string representation of the Integer.

func (Spreadsheet) Trace

func (s Spreadsheet) Trace(msg string)

func (Spreadsheet) Type

func (s Spreadsheet) Type() Type

Type returns the type of the Integer.

type SpreadsheetRow

type SpreadsheetRow struct {
	Values []any
	Uplink *Spreadsheet
}

func NewSpreadsheetRow

func NewSpreadsheetRow(values []any, uplink *Spreadsheet) *SpreadsheetRow

func (SpreadsheetRow) Dump added in v0.0.13

func (s SpreadsheetRow) Dump(e Idxs) string

func (SpreadsheetRow) Equal added in v0.0.11

func (s SpreadsheetRow) Equal(o Object) bool

Do not use when comparing a spreadsheet as a whole because column ordering is not guaranteed

func (SpreadsheetRow) GetKind

func (s SpreadsheetRow) GetKind() int

func (SpreadsheetRow) Inspect

func (s SpreadsheetRow) Inspect(e Idxs) string

Inspect returns a string

func (SpreadsheetRow) Print added in v0.0.13

func (s SpreadsheetRow) Print(e Idxs) string

Inspect returns a string representation of the Integer.

func (SpreadsheetRow) ToDict added in v0.0.19

func (s SpreadsheetRow) ToDict() Dict

func (SpreadsheetRow) ToTxt

func (s SpreadsheetRow) ToTxt() string

func (SpreadsheetRow) Trace

func (s SpreadsheetRow) Trace(msg string)

func (SpreadsheetRow) Type

func (s SpreadsheetRow) Type() Type

Type returns the type of the Integer.

type String

type String struct {
	Value string `bson:"value"`
}

func NewString

func NewString(val string) *String

func (String) Dump added in v0.0.13

func (i String) Dump(e Idxs) string

func (String) Equal added in v0.0.11

func (i String) Equal(o Object) bool

func (String) GetKind

func (i String) GetKind() int

func (String) Inspect

func (i String) Inspect(e Idxs) string

func (String) Print added in v0.0.13

func (i String) Print(e Idxs) string

func (String) Trace

func (i String) Trace(msg string)

func (String) Type

func (i String) Type() Type

type TSeries

type TSeries struct {
	S []Object `bson:"series"`
	// contains filtered or unexported fields
}

func NewBlockFromList added in v0.0.18

func NewBlockFromList(list List) TSeries

func NewTSeries

func NewTSeries(ser []Object) *TSeries

func (*TSeries) Append

func (ser *TSeries) Append(obj Object) *TSeries

func (*TSeries) AppendMul

func (ser *TSeries) AppendMul(objs []Object) *TSeries

func (TSeries) AtLast

func (ser TSeries) AtLast() bool

func (TSeries) Ended

func (ser TSeries) Ended() bool

func (TSeries) Get

func (ser TSeries) Get(n int) Object

func (*TSeries) GetAll

func (ser *TSeries) GetAll() []Object

func (*TSeries) GetPos

func (ser *TSeries) GetPos() int

func (TSeries) Len

func (ser TSeries) Len() int

func (*TSeries) Next

func (ser *TSeries) Next()

func (TSeries) PGet

func (ser TSeries) PGet(n int) *Object

func (TSeries) Peek

func (ser TSeries) Peek() Object

func (*TSeries) Pop

func (ser *TSeries) Pop() Object

func (TSeries) Pos

func (ser TSeries) Pos() int

func (TSeries) PositionAndSurroundingElements added in v0.0.13

func (ser TSeries) PositionAndSurroundingElements(idxs Idxs) string

PositionAndSurroundingElements returns a string of the position of the series, marked with (here) and 10 surrounding elements.

func (*TSeries) Put

func (ser *TSeries) Put(obj Object)

func (*TSeries) Reset

func (ser *TSeries) Reset()

func (*TSeries) RmLast

func (ser *TSeries) RmLast() *TSeries

func (*TSeries) SetPos

func (ser *TSeries) SetPos(pos int)

type Tagword

type Tagword struct {
	Index int
}

func NewTagword

func NewTagword(index int) *Tagword

func (Tagword) Dump added in v0.0.13

func (i Tagword) Dump(e Idxs) string

func (Tagword) Equal added in v0.0.11

func (i Tagword) Equal(o Object) bool

func (Tagword) GetKind

func (i Tagword) GetKind() int

func (Tagword) Inspect

func (i Tagword) Inspect(e Idxs) string

func (Tagword) Print added in v0.0.13

func (b Tagword) Print(e Idxs) string

func (Tagword) ToWord

func (i Tagword) ToWord() Word

func (Tagword) Trace

func (i Tagword) Trace(msg string)

func (Tagword) Type

func (i Tagword) Type() Type

type Time

type Time struct {
	Value time.Time
}

func NewTime

func NewTime(val time.Time) *Time

func (Time) Dump added in v0.0.13

func (i Time) Dump(e Idxs) string

func (Time) Equal added in v0.0.11

func (i Time) Equal(o Object) bool

func (Time) GetKind

func (i Time) GetKind() int

func (Time) Inspect

func (i Time) Inspect(e Idxs) string

func (Time) Print added in v0.0.13

func (i Time) Print(e Idxs) string

func (Time) Trace

func (i Time) Trace(msg string)

func (Time) Type

func (i Time) Type() Type

type Type

type Type int
const (
	BlockType          Type = 1
	IntegerType        Type = 2
	WordType           Type = 3
	SetwordType        Type = 4
	OpwordType         Type = 5
	PipewordType       Type = 6
	BuiltinType        Type = 7
	FunctionType       Type = 8
	ErrorType          Type = 9
	CommaType          Type = 10
	VoidType           Type = 11
	StringType         Type = 12
	TagwordType        Type = 13
	GenwordType        Type = 14
	GetwordType        Type = 15
	ArgwordType        Type = 16
	NativeType         Type = 17
	UriType            Type = 18
	LSetwordType       Type = 19
	CtxType            Type = 20
	DictType           Type = 21
	ListType           Type = 22
	DateType           Type = 23
	CPathType          Type = 24
	XwordType          Type = 25
	EXwordType         Type = 26
	SpreadsheetType    Type = 27
	EmailType          Type = 28
	KindType           Type = 29
	KindwordType       Type = 30
	ConverterType      Type = 31
	TimeType           Type = 32
	SpreadsheetRowType Type = 33
	DecimalType        Type = 34
	VectorType         Type = 35
	OpCPathType        Type = 36
	PipeCPathType      Type = 37
	ModwordType        Type = 38
	LModwordType       Type = 39
)

type Uri

type Uri struct {
	Scheme Word
	Path   string
	Kind   Word
}

func NewUri

func NewUri(index *Idxs, scheme Word, path string) *Uri

func NewUri1

func NewUri1(index *Idxs, path string) *Uri

func (Uri) Dump added in v0.0.13

func (i Uri) Dump(e Idxs) string

func (Uri) Equal added in v0.0.11

func (i Uri) Equal(o Object) bool

func (Uri) GetFullUri added in v0.0.17

func (i Uri) GetFullUri(e Idxs) string

func (Uri) GetKind

func (i Uri) GetKind() int

func (Uri) GetPath

func (i Uri) GetPath() string

func (Uri) GetProtocol

func (i Uri) GetProtocol() Word

func (Uri) Inspect

func (i Uri) Inspect(e Idxs) string

func (Uri) Print added in v0.0.13

func (i Uri) Print(e Idxs) string

func (Uri) Trace

func (i Uri) Trace(msg string)

func (Uri) Type

func (i Uri) Type() Type

type Vector

type Vector struct {
	Value govector.Vector
	Kind  Word
}

Vector -- feture vector (uses govector)

func NewVector

func NewVector(vec govector.Vector) *Vector

func NewVectorFromSeries

func NewVectorFromSeries(block TSeries) *Vector

func (Vector) Dump added in v0.0.13

func (i Vector) Dump(e Idxs) string

func (Vector) Equal added in v0.0.11

func (i Vector) Equal(o Object) bool

func (Vector) GetKind

func (i Vector) GetKind() int

func (Vector) Inspect

func (i Vector) Inspect(idxs Idxs) string

func (Vector) Print added in v0.0.13

func (i Vector) Print(idxs Idxs) string

func (Vector) Trace

func (i Vector) Trace(msg string)

func (Vector) Type

func (i Vector) Type() Type

type Void

type Void struct{}

func (Void) Dump added in v0.0.13

func (i Void) Dump(e Idxs) string

func (Void) Equal added in v0.0.11

func (i Void) Equal(o Object) bool

func (Void) GetKind

func (i Void) GetKind() int

func (Void) Inspect

func (i Void) Inspect(e Idxs) string

func (Void) Print added in v0.0.13

func (b Void) Print(e Idxs) string

func (Void) Trace

func (i Void) Trace(msg string)

func (Void) Type

func (i Void) Type() Type

type Word

type Word struct {
	Index int
}

func NewWord

func NewWord(val int) *Word

func (Word) Dump added in v0.0.13

func (i Word) Dump(e Idxs) string

func (Word) Equal added in v0.0.11

func (i Word) Equal(o Object) bool

func (Word) GetKind

func (i Word) GetKind() int

func (Word) Inspect

func (i Word) Inspect(e Idxs) string

func (Word) Print added in v0.0.13

func (i Word) Print(e Idxs) string

func (Word) Trace

func (i Word) Trace(msg string)

func (Word) Type

func (i Word) Type() Type

type Xword

type Xword struct {
	Index int
	Args  string
}

func NewXword

func NewXword(index int, args string) *Xword

func (Xword) Dump added in v0.0.13

func (i Xword) Dump(e Idxs) string

func (Xword) Equal added in v0.0.11

func (i Xword) Equal(o Object) bool

func (Xword) GetKind

func (i Xword) GetKind() int

func (Xword) Inspect

func (i Xword) Inspect(e Idxs) string

+ strconv.FormatInt(int64(i.Index), 10) +

func (Xword) Print added in v0.0.13

func (b Xword) Print(e Idxs) string

func (Xword) ToWord

func (i Xword) ToWord() Word

func (Xword) Trace

func (i Xword) Trace(msg string)

func (Xword) Type

func (i Xword) Type() Type

Jump to

Keyboard shortcuts

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