-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
GDScript: Transparent funcref and _call #15486
Conversation
Wasn't this also adressed in a more general way by the |
I found the lambda PR now you mentioned it. This PR here is a much smaller change. Lambdas could be added on top of this as a special kind of |
Who is the |
@Geequlim it's the implicit "Class" of the file (in OOP terms, much like Python). |
@Geequlim Yes, it's just the current class instance itself. This could be amended to allow for writing just the name of any class method (i.e. |
2d68d1f
to
b72d7fc
Compare
b72d7fc
to
bfa9147
Compare
I've revised the underlying implementation for this one. Variant 1 and variant 2 above are unchanged. In addition, GDScript users can now access the underlying mechanism that is used for
This new implementation is cleaner. While the old implementation had several core changes and an opcode change, the new implementation has only one very small change to |
bfa9147
to
65b54bf
Compare
As we discussed together in our IRC meeting on June 20 (http://godot.eska.me/irc-logs/devel/2018-06-20.log from 21:10), this should be added in Godot 3.2 following the GDScript roadmap that we agreed upon: godotengine/godot-roadmap#23. I'll close this PR for now, but it will likely be used as a reference for implementing this feature which is planned on the roadmap (and gladly by you or with your help :)). |
On my 3.1 wish list for gdscript: make
funcref
transparent.This PR is a proof of concept, enabling everything you'd expect:
It's still a
funcref
underneath, but the syntax let's you use them like first-class values.