Anonymous user
Define a primitive data type: Difference between revisions
→{{header|Nim}}
Line 1,141:
=={{header|Nim}}==
Subranges are supported by the language and automatically boundchecked:
<lang nim>
MyInt = range[0..10]
var x: MyInt = 5
x = x + 6 # Runtime error:
x = 12 # Compile-time error:
=={{header|OCaml}}==
|