nimp/examples/variables.nimp

20 lines
557 B
Plaintext

# Syntax: define _SYMBOL_ as _TYPE_ with value of _EXPRESSION[_TYPE_]_.
# Or shortcut: define _SYMBOL_ as _EXPRESSION[_TYPE_]_.
define x as integer with value of 42.
define b as boolean. # another comment.
assign true to b.
define bString as string of b.
define constant PI as float with value of 3.14.
define quarterCircle as float with value of PI divided by 2.
define s1 as string with value of "Hello world!".
# Shortcut expressions where type is implied:
define a as sum of 3 and 2.
define c as true or false.
define s2 as "Hello world, again.".