lang: funcs: core: Make module names public
This is needed for when we have nested modules.
This commit is contained in:
@@ -18,6 +18,6 @@
|
||||
package coremath
|
||||
|
||||
const (
|
||||
// moduleName is the prefix given to all the functions in this module.
|
||||
moduleName = "math"
|
||||
// ModuleName is the prefix given to all the functions in this module.
|
||||
ModuleName = "math"
|
||||
)
|
||||
|
||||
@@ -26,7 +26,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
simplepoly.ModuleRegister(moduleName, "mod", []*types.FuncValue{
|
||||
simplepoly.ModuleRegister(ModuleName, "mod", []*types.FuncValue{
|
||||
{
|
||||
T: types.NewType("func(int, int) int"),
|
||||
V: Mod,
|
||||
|
||||
@@ -26,7 +26,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
simple.ModuleRegister(moduleName, "pow", &types.FuncValue{
|
||||
simple.ModuleRegister(ModuleName, "pow", &types.FuncValue{
|
||||
T: types.NewType("func(x float, y float) float"),
|
||||
V: Pow,
|
||||
})
|
||||
|
||||
@@ -26,7 +26,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
simple.ModuleRegister(moduleName, "sqrt", &types.FuncValue{
|
||||
simple.ModuleRegister(ModuleName, "sqrt", &types.FuncValue{
|
||||
T: types.NewType("func(x float) float"),
|
||||
V: Sqrt,
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user