Skip to content
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

Allow swizzle field names in array initialization #4288

Open
Porem5002 opened this issue Sep 21, 2024 · 0 comments
Open

Allow swizzle field names in array initialization #4288

Porem5002 opened this issue Sep 21, 2024 · 0 comments

Comments

@Porem5002
Copy link

This feature comes from something that was previously possible using the raylib bindings.

Until around dev-2023-11, the Color type from raylib was defined as a struct so we could write code like this and it was pretty obvious what it would do:

x: raylib.Color = { r = 127, g = 0, b = 127, a = 255  }

But since then (after this more precisely) this type is defined as a fixed array, which allows for more flexibility but also means that the previous code no longer compiles since those fields don't actually exist in an array.

My request is to allow for this kind of syntax for initializing arrays, making the language more consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant