Keywords
These words have a meaning in Mamba. Do not use them as names of variables or operations.
Declarations
| Keyword |
Meaning |
function |
Declares an operation. The return type follows it. |
static |
The operation belongs to the class, not to an object. |
var |
Declares a variable whose type is taken from its value. |
this |
The object an operation was called on. |
void |
The return type of an operation that returns nothing. |
Decisions
| Keyword |
Meaning |
if, elseif, else |
Conditions. elseif is one word. See Conditions. |
switch, case, default |
Choose between values of one expression. |
Loops
| Keyword |
Meaning |
for |
A counted loop. |
foreach, in |
Visit each element of a collection. |
while |
Repeat while a condition is true. |
See Iterations.
Errors and flow
| Keyword |
Meaning |
try, catch, finally |
Handle errors. catch Exception e takes no parentheses. |
throw |
Raise an error. |
return |
Leave an operation, with a value if it has a return type. |
See Exceptions.
Values and conversion
| Keyword |
Meaning |
true, false |
The two boolean values. |
null |
No value. See Behaviour to know. |
as |
Cast a value to another type, for example x as float. |
Special names
These are not keywords, but they have fixed meanings in the places they are available:
| Name |
Where |
Meaning |
Domain |
Everywhere |
The business objects of the application, as Domain.Product. |
Model |
Form controllers |
The form's model: the data the form is bound to. |
LocalResources |
Everywhere |
Localized text, as LocalResources.Key. |
FormControls |
Form controllers |
The controls of the form, as FormControls.List.SelectedItem. |
Interfaces |
Everywhere |
External API adapters, as Interfaces.<Adapter>.API.<Operation>(...). |