Skip to content

Commit

Permalink
Add imports (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
davydog187 authored Sep 27, 2024
1 parent 0339a11 commit 2d4fb75
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,15 @@

Use the `~LUA` sigil to parse and validate your Lua code at compile time

iex> import Lua, only: [sigil_LUA: 2]

#iex> {[4], _} = Lua.eval!(~LUA[return 2 +])
** (Lua.CompilerException) Failed to compile Lua!

Using the `c` modifier transforms your Lua code into a `t:Lua.Chunk.t/0` at compile-time,
which will speed up execution at runtime since the Lua no longer needs to be parsed

iex> import Lua, only: [sigil_LUA: 2]
iex> {[4], _} = Lua.eval!(~LUA[return 2 + 2]c)

## Exposing Elixir functions to Lua
Expand Down

0 comments on commit 2d4fb75

Please sign in to comment.