Hi Bill, and all:
Did now investigate your program snippet (from your mail as of 16.03.2013, below, at the end), with the following results: 1.) Your program snippet (named Bill_1) does *not* compile at all, and that's why I did investigate it, as a *say* statement *after an exit statement* will never be reached (which is great, thank' to mike's ingenuity checking that at compile time :-) Bill_1.nrx Source code: ================== /* Bill_1: Bill's example from mail 2013-03-17 (ibm-netrexx) */ /* : discussing the overloading of *keywords* */ /*************************************************************/ /* NetRexx 3 */ begin loop i = 1 to 5 say "\n Loop iteration" i if i = 3 then do say " Leave in iteration 3" leave end if i > 3 then say " Why am I still in this loop?" end say "\n Now exit" exit say " Why was the exit was not done?\n" /* Remainder of the program */ method begin static say "\n Begin Test" ---------------------------------------------------------------------------------- Bill_1 NetRexx compilation LOG: NetRexx portable processor, version NetRexx 3.01RC2, build 54-20111013-0038 Copyright (c) RexxLA, 2011. All rights reserved. Parts Copyright (c) IBM Corporation, 1995,2008. Program Bill_1.nrx 21 +++ say " Why was the exit was not done?\n" +++ ^^^ +++ Error: Clause cannot be reached function begin Compilation of 'Bill_1.nrx' failed [one error] *************************************************************************************** Thus, I did modify the program commenting out the unallowed Say after the Exit, as follows: Bill_2.nrx (NetRexx Source): ===================== /* Bill_2: Bill's example from mail 2013-03-17 (ibm-netrexx) */ /* : discussing the overloading of *keywords* */ /* : with the un-allowed SAY statement after the exit */ /* : commented out (Thomas.Schneider, 17.03.2013) */ /*************************************************************/ /* NetRexx 3 */ begin loop i = 1 to 5 say "\n Loop iteration" i if i = 3 then do say " Leave in iteration 3" leave end if i > 3 then say " Why am I still in this loop?" end say "\n Now exit" exit -- The below *say* statement commented out, as this somple -- will *not* compile otherwise (Thomas Schneider, 17.03.2013) -- say " Why was the exit was not done?\n" /* Remainder of the program */ method begin static say "\n Begin Test" This now correct program *does compile*, of course! Bill_2.log (NetRexxC Compilation log) is as follows: ======================================== /* Bill_2: Bill's example from mail 2013-03-17 (ibm-netrexx) */ /* : discussing the overloading of *keywords* */ /* : with the un-allowed SAY statement after the exit */ /* : commented out (Thomas.Schneider, 17.03.2013) */ /*************************************************************/ /* NetRexx 3 */ begin loop i = 1 to 5 say "\n Loop iteration" i if i = 3 then do say " Leave in iteration 3" leave end if i > 3 then say " Why am I still in this loop?" end say "\n Now exit" exit -- The below *say* statement commented out, as this somple -- will *not* compile otherwise (Thomas Schneider, 17.03.2013) -- say " Why was the exit was not done?\n" /* Remainder of the program */ method begin static say "\n Begin Test" ************************************************************************** And the execution does now give: Begin Test Loop iteration 1 Loop iteration 2 Loop iteration 3 Leave in iteration 3 Now exit ********************************************************************************* ********************************************************************************* Thus, in summary: 1.) Your original snippet is *not* related to any Keyword Overloading at all (see my original response on this issue, as *Begin* is *NO KEYWORD* in NetRexx at all. 2.) When the semantic error in your program (Say after Exit) is removed, the program *does work* as expected and designed! 3.) Thus, the wrong behaviour in your original program shall be caused by a coding error on a deeper leve l(most probably in an *called* method, I think!) I think adding a *TRACE METHODS* at the start of your origininal source shall help you to find the cause! ****************************************************************************** Hope this does help a bit, Bill :-) Thomas. ****************************************************************************** PS: and sorry for this lengthy mail. Needless to say how much shorted it would have been when allowing *attachments* ;-) But as I did suggest that so many times, I will *not* repeat this requirement again, and did take the time to do a lot of *Cuts and Pastes* :-) Have a nice Sunday, all! ****************************************************************************** '__________________________________________ Am 17.03.2013 15:09, schrieb Thomas Schneider:
--
Thomas Schneider, IT Consulting; http://www.thsitc.com; Vienna, Austria, Europe _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Thomas Schneider, Vienna, Austria (Europe) :-)
www.thsitc.com www.db-123.com |
On 17/3/13 9:59, Thomas Schneider
wrote:
Perhaps that's because you didn't try to compile **the actual program**. You obviously didn't read the original note very thoroughly, Thomas. That's too bad. You missed the most important part:
If you try again with the actual program, as given, you'll have much "better" results. Tom. _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by ThSITC
Thomas,
Please recompile the whole program, including all THREE of the methods. Possibly you missed the point that I was not disclosing the remainder of the program. Bill On 3/17/2013 10:59 AM, Thomas Schneider
wrote:
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
Free forum by Nabble | Edit this page |