v0.2.1 Latest Latest

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

Go to latest
Published: Feb 7, 2022 License: BSD-3-Clause Imports: 9 Imported by: 1



The mobile package provides a very narrow interface to ivy, suitable for wrapping in a UI for mobile applications. It is designed to work well with the gomobile tool by exposing only primitive types. It's also handy for testing.

TODO: This package (and ivy itself) has global state, so only one execution stream (Eval or Demo) can be active at a time.



This section is empty.


This section is empty.


func Eval

func Eval(expr string) (string, error)

Eval evaluates the input string and returns its output. The output is HTML-safe, suitable for mobile platforms.

func Help

func Help() string

Help returns the help page formatted in HTML.

func Reset

func Reset()

Reset clears all state to the initial value.


type Demo

type Demo struct {
	// contains filtered or unexported fields

Demo represents a running line-by-line demonstration.

func NewDemo

func NewDemo(input string) *Demo

NewDemo returns a new Demo that will scan the input text line by line.

func (*Demo) Next

func (d *Demo) Next() (result string, err error)

Next returns the result (and error) produced by the next line of input. It returns ("", io.EOF) at EOF. The output is escaped.

Jump to

Keyboard shortcuts

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