ivy: robpike.io/ivy/mobile Index | Files

package mobile

import "robpike.io/ivy/mobile"

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.


Package Files

help.go mobile.go

func Eval Uses

func Eval(expr string) (result string, errors error)

Eval evaluates the input string and returns its output. If execution caused errors, they will be returned concatenated together in the error value returned. TODO: Should it stop at first error?

func Help Uses

func Help() string

Help returns the help page formatted in HTML.

func Reset Uses

func Reset()

Reset clears all state to the initial value.

type Demo Uses

type Demo struct {
    // contains filtered or unexported fields

Demo represents a running line-by-line demonstration.

func NewDemo Uses

func NewDemo(input string) *Demo

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

func (*Demo) Next Uses

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.

Package mobile imports 11 packages (graph) and is imported by 3 packages. Updated 2020-06-26. Refresh now. Tools for package owners.