knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

lua51

Lifecycle: experimental CRAN status R build status

The goal of lua51 is to ...

Installation

You can install the development version of lua51 like so:

# FILL THIS IN! HOW CAN PEOPLE INSTALL YOUR DEV PACKAGE?

Example

This is a basic example which shows you how to solve a common problem:

library(lua51)
## basic example code

Rcpp packaging

See Rcpp for full details. This section simply sets out some abbreviated notes. The package applies use_rcpp from usethis in order to set up a C++ package.

usethis::create_tidy_package("lua51")
usethis::use_package_doc()
usethis::use_rcpp()

The package comprises a single Rcpp module.

RCPP_MODULE(lua51) {
  using namespace Rcpp;
}

But why C++ integration when Lua is pure C? The decision is one of style. All of the low-level Lua interface functions interact with a Lua 'State' encapsulating a single mutable Lua state machine. The design wraps this State into an object that you can instantiate using S6 class mechanisms. The S6 layer acts as a thin shim between R's object world and the underlying Lua implementation.



royratcliffe/lua51 documentation built on Feb. 24, 2022, 12:41 a.m.