Introspection: Difference between revisions

Added error at compile time and exit at runtime.
m (→‎{{header|Wren}}: Correction to libheader.)
(Added error at compile time and exit at runtime.)
Line 1,382:
 
=={{header|Nim}}==
In Nim, many checks are done at compile time. So, you have the choice to emit an error or warning at compile time or exit at runtime.
<lang nim>echowhen NimVersion < "1.2":
error "This compiler is too old" # Error at compile time.
 
assert NimVersion >= "1.4", "This compiler is too old." # Assertion defect at runtime.
 
var bloop = -12
Line 1,388 ⟶ 1,392:
when compiles abs(bloop):
echo abs(bloop)</lang>
 
{{out}}
<pre>0.10.312</pre>
12</pre>
 
=={{header|OCaml}}==
Anonymous user