Skip to content

Conversation

@selenil
Copy link
Owner

@selenil selenil commented Jan 13, 2026

No description provided.

Copy link
Contributor

@DynamicCake DynamicCake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just want some clarification on certain decisions


@external(erlang, "glua_ffi", "coerce")
pub fn table(values: List(#(Value, Value))) -> Value
pub fn table(lua: Lua, values: List(#(Value, Value))) -> #(Lua, Value) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this do what luerl:encode but manually?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of nested tables. If we try to call luerl:encode on a list that already have encoded values inside it will result in a runtime error.

src/glua_ffi.erl Outdated
false.

encode(X, St0) ->
case is_encoded(X) of
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I long for the day that we don't need to check is_encoded and instead rely on the type system.
Its fine if this doesn't get fixed.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm exploring a way of removing is_encoded, I will update this when I got it working.

@selenil selenil force-pushed the fix/revert-table-and-userdata-encoder branch from 6ca1b27 to 5dd4aab Compare January 14, 2026 02:51
@DynamicCake
Copy link
Contributor

LGTM

@selenil selenil merged commit 82f9e72 into main Jan 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants