<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:16px"><div id="yui_3_16_0_1_1418801579545_17250" dir="ltr"><span id="yui_3_16_0_1_1418801579545_17270"><font size="3" id="yui_3_16_0_1_1418801579545_18207">Note that once you're used to erlang or functional programming, there's usually little need for an explicit return statement.</font></span></div><div id="yui_3_16_0_1_1418801579545_17250" dir="ltr"><span><font size="3"><br></font></span></div><div id="yui_3_16_0_1_1418801579545_17250" dir="ltr"><span id="yui_3_16_0_1_1418801579545_17265"><font size="3" id="yui_3_16_0_1_1418801579545_18206">However, if you do need it, you can emulate return a bit awkwardly with throw(X) and an appropriate enclosing try ... catch (or perhaps just catch) to capture the result.</font></span></div><div id="yui_3_16_0_1_1418801579545_17250" dir="ltr"><span><font size="3"><br></font></span></div><div id="yui_3_16_0_1_1418801579545_17250" dir="ltr"><span id="yui_3_16_0_1_1418801579545_17811"><font size="3" id="yui_3_16_0_1_1418801579545_18209">Best,</font></span></div><div id="yui_3_16_0_1_1418801579545_17250" dir="ltr"><span id="yui_3_16_0_1_1418801579545_17812"><font size="3" id="yui_3_16_0_1_1418801579545_18210">Thomas</font></span></div><div id="yui_3_16_0_1_1418801579545_17250" dir="ltr"><span><br></span></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"> <font size="2" face="Arial"> On Tuesday, December 16, 2014 9:05 AM, aman mangal <mangalaman93@gmail.com> wrote:<br> </font> </div> <blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"> <br><br> <div class="y_msg_container"><div id="yiv8329766053">Hi everyone,<div><br></div><div>I have seen similar questions before on the forum but I could never understand the reason behind it. Is it due to theoretical reasons such as <i>return </i>statement makes it hard to reason about the program or practical reasons that it is hard to implement it (this doesn't seem right but I cannot think of anything else)?</div><div><br></div><div>Moreover, is there a good alternate to avoid nested case statements? Making more functions just seems tedious. Using <i>catch </i>statement seems another good alternate but my intuition is that it is not good practice, is it?</div><div><br></div><div>Thank you</div><div>Aman Mangal</div><div><a rel="nofollow" target="_blank" href="http://www.prism.gatech.edu/~amangal7">www.prism.gatech.edu/~amangal7</a></div></div><br>_______________________________________________<br>erlang-questions mailing list<br><a ymailto="mailto:erlang-questions@erlang.org" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br><br><br></div> </blockquote> </div> </div> </div> </div></body></html>