calc

package module
v0.0.0-...-db77be4 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

README

calc

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Calc

type Calc interface {
	Eval() interface{}
}

func New

func New(ctx Context, src string) (Calc, error)

type Context

type Context interface {
	Var(name string) func() interface{}
	Call(name string) func(args ...interface{}) interface{}

	Add(a, b interface{}) interface{}
	Sub(a, b interface{}) interface{}
	Mul(a, b interface{}) interface{}
	Div(a, b interface{}) interface{}
	Rem(a, b interface{}) interface{}
	Equal(a, b interface{}) interface{}
	NotEqual(a, b interface{}) interface{}
	Less(a, b interface{}) interface{}
	Greater(a, b interface{}) interface{}
	LessEqual(a, b interface{}) interface{}
	GreaterEqual(a, b interface{}) interface{}
	LogicalOr(a, b interface{}) interface{}
	LogicalAnd(a, b interface{}) interface{}
	BitOr(a, b interface{}) interface{}
	BitAnd(a, b interface{}) interface{}
	BitXor(a, b interface{}) interface{}

	Sub1(a interface{}) interface{}
	Not(a interface{}) interface{}
}
var DefaultContext Context = defaultContext{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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