The behavior is consistent but I agree that the documentation does not make
an explicit statement about it given that we  are accustomed to the idea of
failed expressions cause the surrounding expression to fail. I got bitten
by this assumption long time ago trying to do the exact same thing Art is
doing here.

--Jafar



On Feb 27, 2016 10:10 AM, "David.gamey" <[email protected]> wrote:

> I just looked at the new Unicon book. I'm not sure the behaviour is
> clearly documented.  From page 357...
>
> ‎"return expr return from invocation The return expression exits a
> procedure or method invocation, producing expr as its result. The
> invocation may not be resumed"
>
> David
>
> Sent from my BlackBerry 10 smartphone on the Rogers network.
>   Original Message
> From: David.gamey
> Sent: Saturday, February 27, 2016 10:56 AM
> To: Steve Wampler; [email protected]
> Subject: Re: [Unicon-group] return and failure
>
> 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: [email protected]
> 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 -- [email protected]
> 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
> [email protected]
> 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
> [email protected]
> 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
> [email protected]
> 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
[email protected]
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to