utils

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ADDITION        = "add"
	SUBSTRACTION    = "subtract"
	MULTIPLICATION  = "multiply"
	DIVISION        = "divide"
	NEGATION        = "neg"
	SQUARE          = "sqr"
	SQUAREROOT      = "sqrt"
	ABSOLUTE        = "abs"
	CUBE            = "cube"
	CUBERT          = "cubert"
	REPEAT          = "repeat"
	COMMAND_EXIT    = "exit"
	COMMAND_CANCEL  = "cancel"
	COMMAND_HISTORY = "history"
)

Variables

View Source
var OPERATIONS_PRIORITY = map[string]int{ADDITION: 0, SUBSTRACTION: 0, MULTIPLICATION: 1, DIVISION: 1}
View Source
var OPERATIONS_WITH_MULTIPLE_INPUTS = []string{ADDITION, SUBSTRACTION, MULTIPLICATION, DIVISION}
View Source
var OPERATIONS_WITH_ONE_INPUTS = []string{NEGATION, SQUARE, SQUAREROOT, ABSOLUTE, CUBE, CUBERT}

Functions

func ContainString

func ContainString(list []string, target string) bool

func Filter added in v1.2.0

func Filter[T any](ss []T, test func(T) bool) (ret []T)

func Revert

func Revert(list []string) []string

Types

This section is empty.

Jump to

Keyboard shortcuts

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