New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clua_pushcallback has been added to allow definining metamethods with Go... #3
Conversation
|
I'm not very excited by the idea of having two functions in the module interface (PushCallback and PushGoFunction) with largely overlapping use cases. Without your explanation I would have never guessed why your PushCallback was needed. Can we find another way? for example: a) Make PushGoFunction do what PushCallback does. Both result in a callable object that calls a go function. Does it break anything? b) If the only thing PushCallback is useful for is defining metamethods maybe we should use it internally and export a SetMetaMethod function? Given I don't know the ramifications of (a) I would lean towards (b). Am I missing something? Thank you. |
|
On Wed, Dec 12, 2012 at 4:07 PM, Alessandro Arzilli
That does feel more logical - it was intended for that purpose only. steve d. |
|
Do we have an agreement? :) |
|
On Wed, Dec 12, 2012 at 6:26 PM, Alessandro Arzilli
Personally I'd be happy with any solution which allows metamethods to BTW, what version of Go are you using? I ask because the makefile steve d. |
Ok.
I'm using go 1.0.3, what include is not working? |
|
I changed PushCallback to SetMetaMethod |
|
On Sat, Dec 15, 2012 at 8:10 AM, Alessandro Arzilli
Sorry Alessandro, I was looking at the original afitz repo! Now steve d. |
|
Don't delete it yet though, I think I'm going to merge it once this pull request is completely settled. |
Revert "Upstream merge"
clua_pushcallback has been added to allow definining metamethods with Go functions.
This adds the ability to push Go functions as C closures. It's code hand patched from @stevedonovan's golua repo. Specifically: stevedonovan@3a27ba8 without the changes to GoInterface.
His luar project, which uses golua, then only needs small changes to become compatible with your golua fork.