# Allow \`return\` in \`@parallel\`?

**URL:** <https://discourse.julialang.org/t/allow-return-in-parallel/5845>\
**Category:** Internals & Design\
**Tags:** proposal, parallel, syntax\
**Created:** [September 11, 2017, 5:43pm UTC](https://discourse.julialang.org/t/allow-return-in-parallel/5845 "2017-09-11T17:43:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickeubank](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nickeubank/32/3878_2.png) [@nickeubank](https://discourse.julialang.org/u/nickeubank)\
**Post date:** [September 11, 2017, 5:43pm UTC](https://discourse.julialang.org/t/allow-return-in-parallel/5845/1 "2017-09-11T17:43:43Z")

</div>

I [recently ran into some unexpected behavior](https://github.com/JuliaLang/julia/issues/23450) with the `@parrallel` operator that I think might warrant a syntax change. In particular, since `@parallel` requires specification of a reduction function for value returned by each parallel run, I assumed I should be working with the `@parallel` call similar to how I would treat a function, and included a `return` statement. But turns out, `julia` sees `@parallel` as a loop, and so the return statement caused it to exit the `@parallel`, causing some very hard to figure out errors.

Might I suggest allowing `@parallel` accept `return` statements? It’s implicitly using return values from every pass of the loop, seems like it should allow them to be declared explicitly.
