1.26 Named block

In KC3, a named block is a macro that allows you to do debranching returns. First you create a block using block :name do ... end, then using return or return_from :name you can return an abitrary value from the block, expressions after return are not executed.

In the case where two blocks have the same name, the most inner block is selected for return.

1.26.1 Examples

ikc3> block :abc do
ikc3>   return 1
ikc3>   123
ikc3> end
1
ikc3> block :abc do
ikc3>   return_from :abc 1 + 1
ikc3>   123
ikc3> end
2

Top : KC3 documentation

Previous : 1.25 Facts

Next : 2 HTTPd