nimp/examples/variables.nimp

20 lines
557 B
Plaintext
Raw Permalink Normal View History

# 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.
2023-06-27 04:21:13 +00:00
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.".