Variables & Types
Variable Declarations
PooLang uses the poo keyword to declare variables. By default, variables are immutable, meaning their value cannot be changed after assignment.
poo age << 5;
If you need to reassign a value, you must use the mut keyword:
poo mut score << 0;
score << 10; # This is allowed
Assignment Operator
Note that PooLang uses the << operator for assignment instead of the traditional =. This helps distinguish PooLang code at a glance.
Supported Types
- Integer: Whole numbers (e.g.,
42,-10). - Float: Decimal numbers (e.g.,
3.14,2.0). - String: Text enclosed in double quotes (e.g.,
"Hello"). - Boolean: Truth values (
trueorfalse). - Vector: A collection of values (e.g.,
[1, 2, 3]).
Type Inference
PooLang automatically infers the type of a variable based on the value assigned to it. You do not need to explicitly declare types for variables.