simplepoly

package
v0.0.0-...-173ccf6 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2018 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RegisteredFuncs = make(map[string][]*types.FuncValue) // must initialize

RegisteredFuncs maps a function name to the corresponding static, pure funcs.

Functions

func Len

func Len(input []types.Value) (types.Value, error)

Len returns the number of elements in a list or the number of key pairs in a map. It can operate on either of these types.

func Register

func Register(name string, fns []*types.FuncValue)

Register registers a simple, static, pure, polymorphic function. It is easier to use than the raw function API, but also limits you to small, finite numbers of different polymorphic type signatures per function name. You can also register functions which return types containing variants, if you want automatic matching based on partial types as well. Some complex patterns are not possible with this API. Implementing a function like `printf` would not be possible. Implementing a function which counts the number of elements in a list would be.

Types

This section is empty.

Jump to

Keyboard shortcuts

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