Define a primitive data type: Difference between revisions

Nimrod -> Nim
(add UNIX Shell)
(Nimrod -> Nim)
Line 936:
<code>MyInt</code> can now be used anywhere an <code>INTEGER</code> can, such as the standard arithmetic functions. Trying to assign a value outside of the range of <code>MyInt</code> will result in a compile time warning, and/or a runtime error.
 
=={{header|NimrodNim}}==
Subranges are supported by the language and automatically boundchecked:
<lang nimrodnim>var x: range[1..10] = 10
 
x = 5
Anonymous user