3 ms·
You know what? You might be even able to implement this in Rust! index = num(-1->1000); or something. :D I dunno how attributes would work, but man, they
by johnisgood 6y ago
You know what? You might be even able to implement this in Rust!
index = num(-1->1000);
or something. :D
I dunno how attributes would work, but man, they really are handy. It is very, very difficult to shoot yourself in the foot.
- steveklabnik 6y agoRust's "associated constants" are a very similar feature. You can also do runtime checked ranged integer types, and compile-time checked ones, though that's very awkward at the moment. It'll get un-awkward at some point; an implementation of the feature needed is in nightly.