generics

package
v0.0.0-...-fae6a60 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BinaryOpTokens = map[string]token.Token{
	"Equal":          token.EQL,
	"NotEqual":       token.NEQ,
	"Add":            token.ADD,
	"Subtract":       token.SUB,
	"Multiply":       token.MUL,
	"Divide":         token.QUO,
	"Remainder":      token.REM,
	"BitwiseAnd":     token.AND,
	"BitwiseOr":      token.OR,
	"BitwiseXor":     token.XOR,
	"BitClear":       token.AND_NOT,
	"LeftShift":      token.SHL,
	"RightShift":     token.SHR,
	"Less":           token.LSS,
	"LessOrEqual":    token.LEQ,
	"Greater":        token.GTR,
	"GreaterOrEqual": token.GEQ,
}

BinaryOpTokens are all the binary operations

Functions

func Add

func Add(x, y interface{}) interface{}

Add calls the '+' operator

func BitClear

func BitClear(x, y interface{}) interface{}

BitClear calls the '%^' operator

func BitwiseAnd

func BitwiseAnd(x, y interface{}) interface{}

BitwiseAnd calls the '&' operator

func BitwiseOr

func BitwiseOr(x, y interface{}) interface{}

BitwiseOr calls the '|' operator

func BitwiseXor

func BitwiseXor(x, y interface{}) interface{}

BitwiseXor calls the '^' operator

func Divide

func Divide(x, y interface{}) interface{}

Divide calls the '/' operator

func Equal

func Equal(x, y interface{}) bool

func Greater

func Greater(x, y interface{}) bool

func GreaterOrEqual

func GreaterOrEqual(x, y interface{}) bool

func LeftShift

func LeftShift(x, y interface{}) interface{}

LeftShift calls the '<<' operator

func Less

func Less(x, y interface{}) bool

func LessOrEqual

func LessOrEqual(x, y interface{}) bool

func Multiply

func Multiply(x, y interface{}) interface{}

Multiply calls the '*' operator

func NewSorter

func NewSorter(
	len func() int,
	swap func(i, j int),
	less func(i, j int) bool,
) sort.Interface

NewSorter creates a new sorter from functions

func NotEqual

func NotEqual(x, y interface{}) bool

func Remainder

func Remainder(x, y interface{}) interface{}

Remainder calls the '%' operator

func RightShift

func RightShift(x, y interface{}) interface{}

RightShift calls the '>>' operator

func Subtract

func Subtract(x, y interface{}) interface{}

Subtract calls the '-' operator

func To_complex128

func To_complex128(x interface{}) complex128

To_complex128 converts anything to a complex128

func To_complex64

func To_complex64(x interface{}) complex64

To_complex64 converts anything to a complex64

func To_float32

func To_float32(x interface{}) float32

To_float32 converts anything to a float32

func To_float64

func To_float64(x interface{}) float64

To_float64 converts anything to a float64

func To_int

func To_int(x interface{}) int

To_int converts anything to a int

func To_int16

func To_int16(x interface{}) int16

To_int16 converts anything to a int16

func To_int32

func To_int32(x interface{}) int32

To_int32 converts anything to a int32

func To_int8

func To_int8(x interface{}) int8

To_int8 converts anything to a int8

func To_string

func To_string(x interface{}) string

func To_uint

func To_uint(x interface{}) uint

To_uint converts anything to a uint

func To_uint16

func To_uint16(x interface{}) uint16

To_uint16 converts anything to a uint16

func To_uint64

func To_uint64(x interface{}) uint64

To_uint64 converts anything to a uint64

func To_uint8

func To_uint8(x interface{}) uint8

To_uint8 converts anything to a uint8

func To_uintptr

func To_uintptr(x interface{}) uintptr

To_uintptr converts anything to a uintptr

Types

type Any

type Any interface{}

Any is any type

type T1

type T1 interface{}

T1 is a generic type

type T2

type T2 interface{}

T2 is a generic type

type T3

type T3 interface{}

T3 is a generic type

type T4

type T4 interface{}

T4 is a generic type

type T5

type T5 interface{}

T5 is a generic type

type T6

type T6 interface{}

T6 is a generic type

type T7

type T7 interface{}

T7 is a generic type

type T8

type T8 interface{}

T8 is a generic type

type T9

type T9 interface{}

T9 is a generic type

Jump to

Keyboard shortcuts

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