Jafar,

I wrote the test suite after thinking about documenting the return behaviour.  I realised that just saying it returned to the caller could also be misinterpreted. It returns the value or the failure to the caller.  Sort of deferring the failure or failing within the callers context ‎.

David

Sent from my BlackBerry 10 smartphone on the Rogers network.
From: Jafar Al-Gharaibeh
Sent: Tuesday, March 1, 2016 11:21 AM
To: Steve Wampler
Cc: David Gamey; unicon-group@lists.sourceforge.net; Art Eschenlauer
Subject: Re: [Unicon-group] return and failure

R3 and R4 are both consistent with Art's finding. Both failed _expression_ (1< 0) and (\&null) didn't stop "return" from exiting the function. In both cases the call to the function failed as a result of returning the result of a failed _expression_.

--Jafar


On Tue, Mar 1, 2016 at 10:06 AM, Steve Wampler <swamp...@noao.edu> wrote:
Nice set of example.

"fail" is equivalent to "return &fail" - that is, it exits the
procedure or method with failure.  "&fail" simply fails in the
current _expression_, forcing backtracking (if any sub-expressions
are suspended, of course).  "return" bounds its _expression_
and produces as the outcome of the invocation the outcome of the
evaluation of that _expression_, where an empty _expression_ evaluates
to &null.  So "return" and "return &null" are equivalent.

[Uh, that could have been worded better...]

I think all of the procedure calls in the example code you have are
consistent with that behavior.


--
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

Reply via email to