qalc

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

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

Go to latest
Published: Apr 18, 2021 License: MIT Imports: 4 Imported by: 0

README

qalc

Documentation

Overview

qalc provides a wrapper for the `qalc` executable from Qalculate. `qalc` is an advanced calculator capable of things such as solving equations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TypeFunc

func TypeFunc(answers []interface{}, tf TypeFuncs)

TypeFunc is a convenience function that loops through each parsed output and runs the appropriate functions stored in an instance of TypeFuncs

Types

type Qalc

type Qalc struct {
	Commands []string
}

Qalc stores commands that will be provided to the `qalc` executable

func New

func New(commands ...string) *Qalc

New creates a new Qalc struct with the provided commands

func (*Qalc) AddCommands

func (q *Qalc) AddCommands(commands ...string)

AddCommands adds commands to a Qalc instance

func (*Qalc) Execute

func (q *Qalc) Execute() ([]interface{}, error)

Execute runs the `qalc` executable reading from Stdin, setting Stdin to commands separrated by newline

type TypeFuncs

type TypeFuncs struct {
	Float   func(float64)
	Bool    func(bool)
	Default func(string)
}

TypeFuncs stores functions to be run if a certain type is found

Jump to

Keyboard shortcuts

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