Why do we need to denote a function, with fn, def, function, ...? we can do better than this.
main() {
something() {
// implementation block for something(), or anonymous scope?
}
something() // first or second execution?
}Why is that hard for you?
Also, as mentioned, in many languages it is valid syntax for an invocation of something, followed by a new scope.
var x = 1;
something();
{
var x = 2;
}
// x is now 1 again, as the scope
// containing the new variable x=2 is gone
something();
or, as mentioned in another comment, is it passing an execution block to `something()`? (I didn't mention that in my original since it's a bit less common of a language feature, but it's valid too)enforced semicolons and/or significant whitespace/newlines can resolve this in some cases, but it of course depends on the language. and diverging too far from common langs has its own downsides too, especially where you're changing the interpretation of what are already common patterns.