Art, I'm pretty certain it's consistent. Agreed it can be counter intuitive. I think that I realized it when I coded
return &fail This should work return \value | fail It should also force a wtf moment if someone forgets or doesn't know. David Sent from my BlackBerry 10 smartphone on the Rogers network. Original Message From: Steve Wampler Sent: Saturday, February 27, 2016 10:17 AM To: unicon-group@lists.sourceforge.net Subject: Re: [Unicon-group] return and failure On 02/26/2016 09:01 PM, Art Eschenlauer wrote: > I expected: > "return \value failed" > from the following program but instead got > "test() failed" > because I expected the expression > return \value > to fail (without returning) when value is &null. > Why did I get the results that I got? > What is special about the expression "return expr"? While "return expr" could have been defined as you expected, it was defined differently. "return" always exits the procedure or method, producing the outcome of "expr" as the outcome of the procedure or method call. I believe this behavior is defined consistently across both Icon and Unicon, though I haven't looked at the Icon book for a while. The Unicon book defines "return"s behavior this way. -- Steve Wampler -- swamp...@noao.edu The gods that smiled on your birth are now laughing out loud. ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Unicon-group mailing list Unicon-group@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/unicon-group ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Unicon-group mailing list Unicon-group@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/unicon-group