Skip to content

Conversation

@dalexeev
Copy link
Member

@dalexeev dalexeev commented Jun 15, 2023

Draft because godotengine/godot#77129 hasn't been merged yet.

Comments are very welcome.

@Piralein Piralein added enhancement area:manual Issues and PRs related to the Manual/Tutorials section of the documentation labels Jun 15, 2023
@Piralein Piralein added this to the 4.1 milestone Jun 15, 2023
@dalexeev dalexeev marked this pull request as ready for review June 25, 2023 15:20
func _init():
super(5)

Static constructor
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
Static constructor
Static initializer

?

Copy link
Contributor

@NathanLovato NathanLovato left a comment

Choose a reason for hiding this comment

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

Great contribution overall, I left some suggestions that I think would help make this more accessible.

B.x = 3
prints(A.x, B.x) # 3 3

Static functions can use static member variables. A static variable initializer can call a static function.
Copy link
Contributor

Choose a reason for hiding this comment

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

The first sentence is mentioned before. The second sentence means that you can write something like this, right?

static var a = some_static_function(value)

If so, it'd be good to have a snippet here.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've removed this as it's more related to #7507.

@MisoMosiSpy
Copy link
Contributor

This change also fixes #7487.

Copy link
Contributor

@MisoMosiSpy MisoMosiSpy left a comment

Choose a reason for hiding this comment

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

Look good to me now, thanks!

@skyace65
Copy link
Contributor

skyace65 commented Jul 4, 2023

@NathanLovato any other changes you think need to be made?

@NathanLovato
Copy link
Contributor

@skyace65 all good!

@skyace65 skyace65 merged commit 23de3fa into godotengine:master Jul 5, 2023
@skyace65
Copy link
Contributor

skyace65 commented Jul 5, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:manual Issues and PRs related to the Manual/Tutorials section of the documentation enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

State that static variables are supported

6 participants