Example #1
0
File: bool.go Project: jnb666/gogp
// Unary constructor returns a boolean unary operator which implements the gp.Opcode interface
func Unary(name string, fun func(a V) V) gp.Opcode {
	return unaryOp{gp.Function(name, 1), fun}
}
Example #2
0
File: bool.go Project: jnb666/gogp
// Func constructor returns a boolean function with given arity which implements the gp.Opcode interface
func Func(name string, arity int, fun func([]V) V) gp.Opcode {
	return boolFunc{gp.Function(name, arity), fun}
}