You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
+
## [v0.2.0] - 2025-05-14
9
+
10
+
### Changed
11
+
- Any data returned from a `deflua` function, or a function set by `Lua.set!/3` is now validated. If the data is not an identity value, or an encoded value, it will raise an exception. In the past, `Lua` and Luerl would happily accept bad values, causing downstream problem is the program. This led to unexpected behavior, where depending on if the data passed was decoded or not, the program would succeed or fail
12
+
8
13
9
14
## [v0.1.1] - 2025-05-13
10
15
@@ -26,6 +31,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
26
31
- Tables must now be explicitly decoded when receiving as arguments `deflua` and other Elixir callbacks
This allows you to have simple, expressive APIs that access context that is unavailable to the Lua code.
162
162
163
+
## Encoding and Decoding data
164
+
165
+
When working with `Lua`, you may want inject data of various types into the runtime. Some values, such as integers, have the same representation inside of the runtime as they do in Elixir, they do not require encoding. Other values, such as maps, are represented inside of `Lua` as tables, and must be encoded first. Values not listed are not valid and cannot be encoded by `Lua` and Luerl, however, they can be passed using a `{:userdata, any()}` tuple and encoding them.
`list(any())` | `list(luerl type)` | maybe (if any of its values require encoding)
182
+
183
+
184
+
## Userdata
185
+
186
+
There are situations where you want to pass around a reference to some Elixir datastructure, such as a struct. In these situations, you can use a `{:userdata, any()}` tuple.
Trying to deference userdata inside a Lua program will result in an exception.
201
+
202
+
163
203
## Credits
164
204
165
205
`Lua` piggy-backs off of Robert Virding's [Luerl](https://github.com/rvirding/luerl) project, which implements a Lua lexer, parser, and full-blown Lua virtual machine that runs inside the BEAM.
0 commit comments