Documentation
¶
Overview ¶
Package callbacks has Go functions that take Python callables, and call them before returning.
Index ¶
- func Apply(x float64, f func(x float64) float64) float64
- func CallKept(i int)
- func CallKeptCheck(i int) bool
- func Count(n int, keep func(i int) bool) int
- func Describe(fun func(v interface{}))
- func Each(n int, fun func(i int, label string))
- func InGoroutine(fun func(i int))
- func Keep(fun func(i int))
- func KeepCheck(check func(i int) bool)
- func Label(i int, f func(i int) string) string
- func Mixed(fun func(on bool, x float64, u uint8))
- func Sum(n int, val func(i int) int) int
- func Twice(fun func())
- func Widest(n int, size func(i int) uint) uint
- type Counter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CallKept ¶
func CallKept(i int)
CallKept calls the func Keep stored, outside the call it was passed to.
func CallKeptCheck ¶
CallKeptCheck reports what the func KeepCheck stored answers for i, outside the call it was passed to.
func Describe ¶
func Describe(fun func(v interface{}))
Describe calls fun with a string and a fmt.Stringer, as interface{} values. They arrive as strings, made by fmt.Sprintf("%s", v).
func InGoroutine ¶
func InGoroutine(fun func(i int))
InGoroutine calls fun from another goroutine, and waits for it.
func Keep ¶
func Keep(fun func(i int))
Keep stores fun, for CallKept to call after Keep has returned.
func Label ¶ added in v0.6.1
Label returns f(i). The plain-C backends skip it: they can't take a string back from Python.