ziglang / zig

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
https://ziglang.org
MIT License
33.67k stars 2.47k forks source link

[Proposal]: initialize multiple variables at once. #20917

Closed MubinMuhammad closed 1 month ago

MubinMuhammad commented 1 month ago

Zig Version

0.14.0

The Enhancement

In Zig, I would assume it can initialize multiple variables at once with the following syntax:

var i, j, k: u32 = 0;

I think it is an enhancement to the language. Thanks.

Luukdegram commented 1 month ago

https://github.com/ziglang/zig/wiki/Language-Proposals

mlugg commented 1 month ago

Also, please see Aggregate Destructuring.

MubinMuhammad commented 1 month ago

Thanks.