Language construct naming: Function/Goto
- by sub
How is a language construct with the following properties called?
It has a beginning and an end, just like a function
It has a header containing it's name, also like a function but without arguments
There can be any number of statements between its beginning and end, like a function
You can use a function to jump to its beginning from anywhere (even itself) and it will execute the statements contained in it until it reaches its end
You can use a function to immediately stop the execution of its contents and jump back where it was called from
The code it contains is in the same scope as everything else, so you can access all variables outside and create new ones which aren't deleted upon leaving the construct.
All in all it is like a goto point with an end and the option to return where it was called from.