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

Proposal: apply RLS to @splat, eliminating its length parameter #16277

Closed
mlugg opened this issue Jun 30, 2023 · 0 comments · Fixed by #16346
Closed

Proposal: apply RLS to @splat, eliminating its length parameter #16277

mlugg opened this issue Jun 30, 2023 · 0 comments · Fixed by #16346
Labels
accepted This proposal is planned. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone

Comments

@mlugg
Copy link
Member

mlugg commented Jun 30, 2023

Status quo:

const x = @splat(4, @as(u32, 123)); // .{ 123, 123, 123, 123 }

Proposal:

// result type used to infer length and elem type
const x: @Vector(4, u32) = @splat(123); // .{ 123, 123, 123, 123 }

This brings similar advantages to #5909, and fits nicely with it. @splat's current usage is quite unpleasant for constants in particular, due to the need to annotate the element type with @as - this would reduce visual noise in most cases.

@andrewrk andrewrk added the proposal This issue suggests modifications. If it also has the "accepted" label then it is planned. label Jun 30, 2023
@andrewrk andrewrk added this to the 0.12.0 milestone Jun 30, 2023
@andrewrk andrewrk added the accepted This proposal is planned. label Jun 30, 2023
@andrewrk andrewrk modified the milestones: 0.12.0, 0.11.0 Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted This proposal is planned. proposal This issue suggests modifications. If it also has the "accepted" label then it is planned.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants