4 ms·
One limitation is that although "int" can be sub-typed, such a variable cannot directly index a slice.
by everybodyknows 8y ago
One limitation is that although "int" can be sub-typed, such a variable cannot directly index a slice.
- zeeboo 8y agoI’m confused. First, there’s no notion of sub-typing in Go. Second, the closest thing I can think of what you mean does work: https://play.golang.org/p/IE9sg4CwCd_C https://play.golang.org/p/IE9sg4CwCd_C
- JohnStrangeII 8y agoRust doesn't have proper integer subtypes either. Ada has.
- steveklabnik 8y agoAren’t ada’s runtime checked? You can do that in Rust.
- pjmlp 8y agoOnly if it cannot be proven at compile time.
- steveklabnik 8y agoInteresting. You wouldn’t happen to have a link to docs, would you?
- pjmlp 8y agoThe docs are the Ada language standard. http://www.ada-auth.org/standards/index.html http://www.ada-auth.org/standards/index.html Like with other languages, each vendor is free to do their best for optimizations, while keeping language semantics. Besides Ada Core, there are a couple others but at enterprise budget levels. http://www.adaic.org/ada-resources/pro-tools-services/ http://www.adaic.org/ada-resources/pro-tools-services/
- steveklabnik 8y agoThanks