[WIP] Adding new register_function macro#38
Open
jwoertink wants to merge 1 commit intoveelenga:masterfrom
Open
[WIP] Adding new register_function macro#38jwoertink wants to merge 1 commit intoveelenga:masterfrom
jwoertink wants to merge 1 commit intoveelenga:masterfrom
Conversation
…ce that's available in Lua space. Fixes veelenga#15
jwoertink
commented
Aug 29, 2021
| {% end %} | ||
|
|
||
| # push result to stack | ||
| LibLua.pushnumber(state, {{ proc.body }}) |
Author
There was a problem hiding this comment.
I'm assuming if one of the proc.args is a String, then we would call LibLua.pushstring here? But that expected a Pointer(UInt8) to be passed in... But also, what happens if the first arg is a String, and the second is a number? Does the value of each arg need to be pushed separately?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #15
This is currently just WIP because I don't really understand the Lua internals. I know the implementation will need some work as it currently only works with
Float64.With this, you'll be able to define a proc in Crystal, and then name it. Then from Lua you will be able to execute that proc as a function.