On Thu, Oct 18, 2012 at 11:51 AM, Tom Szczesny <[email protected]> wrote: > Thank you for all your comments. They are very useful. > > Just for context for my initial question: > I am attempting to resolve: > https://github.com/kevinlawler/kona/issues/4 > and was hoping to see how J did it. > > However the approach in J is quite different than for A+ or K > in that "return." is a control structure in J.
Early return is very like exception handling. An exception can be thought of as a way of tracking intermediate results -- in essence, you've got an if statement which, after you've got the intermediate value has a test based on whether you are bailing out early -- it wraps the subsequent code. In the "return now case" you are done. In the "normal case" you run the subsequent code to find the value to be returned by that routine. -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
