A `do` block introduces an anonymous function, so a return is fine (although note that it'll return from the do block, not the outer function).
On Thu, Apr 23, 2015 at 10:07 PM Julia User <[email protected]> wrote: > Example: > > function example(txt; indent=true) > open(file, "w") do f > result = somefunc(f, txt; indent=indent) > return result > end > end > > Just a question: is it in julia valid to return within a do part or does > this has problems with closing the file? > > Thanks > > > > >
