Tutorial by Examples

Although not traditionally considered loops, the @goto and @label macros can be used for more advanced control flow. One use case is when the failure of one part should lead to the retry of an entire function, often useful in input validation: function getsequence() local a, b @label start ...
In languages such as C, the @goto statement is often used to ensure a function cleans up necessary resources, even in the event of an error. This is less important in Julia, because exceptions and try-finally blocks are often used instead. However, it is possible for Julia code to interface with C ...

Page 1 of 1