Variables
Budgie allows for creating variables with the variable command. It requires the variable name, the type of the variable, and an optional default value.
Untyped languages such as JavaScript will skip printing the variable type.
Pythonic languages such as Python and Ruby will skip declaring variables without a default value.
1
comment line : Simple declarations
2
variable : foo string
3
variable : bar number 7
4
​
5
comment line : Assignments
6
variable : qux string foo
7
variable : baz number bar
8
​
9
comment line : Interesting values
10
variable : quux number infinity
11
variable : corge boolean true
Copied!
In C#:
1
// Simple declarations
2
string foo;
3
double bar = 7;
4
​
5
// Assignments
6
string qux = foo;
7
double baz = bar;
8
​
9
// Interesting values
10
double quux = double.PositiveInfinity;
11
bool corge = true;
Copied!
In Python:
1
# Simple declarations
2
bar = 7
3
​
4
# Assignments
5
qux = foo
6
baz = bar
7
​
8
# Interesting values
9
quux = inf
10
corge = True
Copied!

Types

As you saw from the interesting values above, some types such as infinity or true/false have aliases per language.
Built-in types will always be lower-case in Budgie. Uppercase types will always refer to user-defined classes.
Last modified 2yr ago
Copy link
Contents
Types