Re:How to make your C codebase Rusty: rewriting keyboard fir...
by Ar-Curunir on Thursday November 21, 2019 @08:32PM
(#21601665)
You can already define a custom type which will allow you to have a nice syntax for multidimensional arrays: `Matrix<1,2,3>`. It solves your issue of nesting brackets, and you can impl arbitrary indexing for it.
[ Parent
| on HN ]
Re:How to make your C codebase Rusty: rewriting keyboard fir...
by kazagistar on Thursday November 21, 2019 @09:20PM
(#21601891)
Unfortunately, rust does not have numeric types outside the special case baked in arrays, so it cannot do that yet afaik. There is a ticket for it, but it needs work.
Re:How to make your C codebase Rusty: rewriting keyboard fir...
by steveklabnik on Thursday November 21, 2019 @09:49PM
(#21602004)
You can sorta do it kinda today: https://crates.io/crates/typenum
But it will be much nicer and better once const generics lands, it's true.
Re:How to make your C codebase Rusty: rewriting keyboard fir...
by Ar-Curunir on Thursday November 21, 2019 @11:52PM
(#21602668)
You can do it in nightly already.