-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Lambda expressions in GDScript #12170
Conversation
Squashed version of godotengine#2704. Edit by Rémi Verschelde: Squashed all changes in one commit and fixed some indentation issues. Also applied clang-format to match the new master branch.
pretty_print copyright headers are outdated (without contributors / year 2016 / outdated website link)? |
This is not a good solution. I think there are a lot of good ideas in this PR but you should create different PR for the several enhancements you are doing.
|
@Noshyaar I missed this, and it is fixed.
I just rebase the source code and make the Lambda expressions could run on the newest gdscript. |
The lambda branch is waay old (based on 2.1, that's why there are all these unrelated changes @groud mentioned). |
Oh ok, I didn't check the branch this PR was supposed to be merged. |
@Hinsbart Already rebased. |
You need to rebase it on master (not the lambda branch), |
Yes I changed the base branch to master, but it seems like it wasn't rebased to master correctly. |
Yes, the first part of my message "You need to rebase it on master" is still valid. ^^ |
To properly update your lambda branch, you need to do:
|
will this allow:
? or will I have to do
|
@LeonardMeagher2 Yes, It is allowed. |
@akien-mga I am confused. Is this branch ok?(https://github.com/dbsGen/godot/tree/lambda2) And should I open a new PR? |
@dbsGen No, unfortunately it's still not ok. It seems you rebased master on top of the lambda branch, not the other way round. |
@Hinsbart How about this branch https://github.com/dbsGen/godot/tree/lambda3 ? |
@Hinsbart I tried many, is this ok? (https://github.com/dbsGen/godot/tree/l2 ) |
For the record, there is no plan to add lambdas to GDScript for 3.0 as this stage of development. On the other hand, there are many improvements planned for GDScript in 3.1, and discussing and implementing lambda support might be part of them. |
> No description provided. what's the use case for this? why would a game developer need to utilize lambda expressions, to help make their game? |
@vnen thx, i personally havn't used them but i can see the need now, with that code sample in 2704. does make some code look nicer |
@dbsGen You will need to learn how to use Git in order to submit code to Godot. Here's how I'd do it:
|
First of all, a huge thanks @dbsGen for your work on this feature, and the several iterations it went through as Godot moved on and the feature proposal didn't get merged. Lambda expressions are a popular feature request for GDScript and definitely something we want to add, but we want do things right™ and our implementation ideas have matured a lot over the years, for this and related features. The current plan is outlined in godotengine/godot-roadmap#23, and is lead mainly by @vnen who implemented optional typing recently and will go on to other GDScript improvements. Lambdas are currently planned for Godot 3.2. As such I'll close this PR, since it won't be merged as is and the lambdas syntax will likely be reimplemented on top of the new features @vnen is working on. He will likely use your work as a reference, and you'll be very welcome to contribute to it when the time comes (or potentially do the implementation after discussing it with @vnen). |
No description provided.