Nested Methods (Local Functions)
Local functions can be declared inside every other method. When vala compiles such functions, they are turned into private methods. Their capabilities will be restricted by the underlying lambda expression.
https://csharp-book.softuni.org/Content/Chapter-10-methods/nested-methods/nested-methods.html
void main () {
int x = 23, y = 42;
int foo () {
return x + y;
}
assert (foo () == 65);
}