I thought I check this out because, frankly it's a bit confusing.
The following:

procedure main()
&trace := -1
L := [ R1, R2, R3, R4, S1, F1, F2 ]
every (\!L)()
end
procedure R1(); return 1; end
procedure R2(); return &fail; return -1; end
procedure R3(); return 1 < 0; return -1; end
procedure R4(); return \&null; return -1; end
procedure S1(); suspend 1; suspend 2; suspend &fail; suspend 1 < 0; suspend 4; 
end
#procedure F1(); fail 1; end     # fail doesn't take an expr and gives a syntax 
error
#procedure F2(); fail &fail; end
Produced:
Semantics.icn:    4  | R1()
Semantics.icn:    7  | R1 returned 1   # expected
Semantics.icn:    4  | R2()
Semantics.icn:    9  | R2 failed        # I can't recall if &fail is the same 
as fail or a failure as I never use it 
Semantics.icn:    4  | R3()
Semantics.icn:   11  | R3 failed        # isn't this in conflict with art's 
finding
Semantics.icn:    4  | R4()
Semantics.icn:   13  | R4 failed        # isn't this in conflict with art's 
finding
Semantics.icn:    4  | S1()
Semantics.icn:   15  | S1 suspended 1
Semantics.icn:    4  | S1 resumed
Semantics.icn:   15  | S1 suspended 2
Semantics.icn:    4  | S1 resumed
Semantics.icn:   15  | S1 suspended 4
Semantics.icn:    4  | S1 resumed
Semantics.icn:   15  | S1 failed
Semantics.icn:    5  main failed
David

 
      From: Steve Wampler <swamp...@noao.edu>
 To: unicon-group@lists.sourceforge.net 
 Sent: Saturday, February 27, 2016 1:17 PM
 Subject: Re: [Unicon-group] return and failure
   
On 02/27/2016 09:43 AM, Jafar Al-Gharaibeh wrote:
> 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.
 > ...

It's interesting how we can all read the same description and see it 
differently.  I read that as:

  "exits the procedure or method invocation" - not "exits the procedure or 
method invocation
  only if the expression succeeds".  I would have preferred the rest of 
sentence to say that "the
  outcome of the invocation is the outcome of the expression", but found the 
meaning clear.

Mind you, since I rarely read documentation, I admit to having tested that 
behavior back in the past!


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

Reply via email to