functions

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Code generated by gobindlua; DO NOT EDIT.

Example
package main

import (
	"log"

	lua "github.com/yuin/gopher-lua"
)

const script = `
local functions = require "functions"

functions.print_me(functions.split("foo_bar", "_"), functions.split("eggs&ham", "&"))

print("NotIncluded was excluded from the bindings: " .. tostring(functions.not_included == nil))
`

func main() {
	L := lua.NewState()
	defer L.Close()

	// For pure functions, we use the PreloadModule function instead of gobindlua.Register.
	L.PreloadModule("functions", FunctionsModuleLoader)

	if err := L.DoString(script); err != nil {
		log.Fatal(err)
	}

}
Output:

[foo bar] [eggs ham]
NotIncluded was excluded from the bindings: true

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func FunctionsModuleLoader added in v0.0.9

func FunctionsModuleLoader(L *lua.LState) int

func NotIncluded

func NotIncluded()

Since the -i option was specified, this function was not included.

func PrintMe

func PrintMe(args ...any)

func Split

func Split(s string, spl string) []string

Types

This section is empty.

Jump to

Keyboard shortcuts

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