GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — lua-pure/examples at main · htcom-code/lua-pure

Expand file tree

/

examples

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

examples

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
basic
basic
 
 
channel-timeout
channel-timeout
 
 
channel
channel
 
 
customlib
customlib
 
 
debugger
debugger
 
 
embed
embed
 
 
openlib
openlib
 
 
sandbox
sandbox
 
 
userdata
userdata
 
 
README.md
README.md
 
 

README.md

Examples

Runnable programs for the luapure embedding API. Each is a standalone main.go importing github.com/htcom-code/lua-pure/lua (no other dependencies), so they compile under go build ./... and stay current with the API.

Run one with go run ./examples/<name>:

example shows
basic the README quickstart — expose a Go function, run a script, read results
embed hand a Go table to a script; ToValue/FromValue data round-trip
userdata bind a Go type as userdata with a method table and CheckUserData
sandbox NewSandbox + per-call _ENV (RunWith) + a SetContext deadline
channel a Go channel as userdata: two goroutines/LStates message-pass
channel-timeout cancellable channel recv via L.Context() + a SetContext deadline
openlib write a library that installs like a built-in (OpenString-style): a free OpenX(L) opener that exposes Go helpers as a global
customlib register host modules with Requiref (eager) and Preload (lazy)
debugger in-process Debugger: set a breakpoint, inspect the frame, Eval in scope, resume

For small, doc-integrated snippets see the runnable Example functions in lua/example_test.go (they render in make doc-web). The full API surface is in make doc; differences from PUC are in docs/COMPATIBILITY.md.

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.