Skip to content

Variables

Mel Florance edited this page Jul 23, 2020 · 8 revisions

Bird Lang supports variables to store numbers or boolean values.

Assignation

You can assign variables with the var keyword:

Example:

> var a = 2
2

Access

You can access variables just by refering to its identifier:

Example:

> a + 3
5

Algebra

Like in algebra, you can use variables to do various types of operations, like using them with expressions, comparison etc...

Example:

> var a = 2
2
> var b = 4
4
> var c = a * b
8

Clone this wiki locally