Hello George, and all, again:
The *CLUMSY*, as I see it, does come from the SYNTAX: IF condition [;] THEN [;] instruction *or* SELECT ... WHEN condition [;] THEN [;] instruction The first (optional) semicolon *or Carriage Return* is *NO Problem at all*! What has to catered for, is the currently OPTIONAL Semicolon AFTER the THEN! Thus, IF condition THEN instruction -- is a SIMPLE IF IF condition THEN instructions -- as Rony spelled it END IF Shall be a Structured IF statement.. Then, of course, even the keyword THEN might be optional... e.g.: IF condition instructions END IF Same with ELSE, WHEN, etc, of course... Comprendi? Thomas. Am 21.11.2011 15:23, schrieb George Hovey: Hi Kermit, --
Thomas Schneider (Founder of www.thsitc.com) Member of the Rexx Languge Asscociation (www.rexxla.org) Member of the NetRexx Developer's Team (www.netrexx.org) _______________________________________________ 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 |
In reply to this post by billfen
*and*, that is the one and only one *fault*:
Having different syntactic representations *without* a different *semantic meaning*! Thomas. Am 21.11.2011 16:53, schrieb Bill Fenlason: Note that in NetRexx, the following are all equivalent: --
Thomas Schneider (Founder of www.thsitc.com) Member of the Rexx Languge Asscociation (www.rexxla.org) Member of the NetRexx Developer's Team (www.netrexx.org) _______________________________________________ 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 |
In reply to this post by christel.u.w.pachl christel.u.w.pachl
Hello Walter,
whilst IF is a statement(!) ELSE after an IF is NOT recognised That's what I'm talinkg about (relating HUMAN oriented Languages!!) Thomas. ================================================================ Am 21.11.2011 17:10, schrieb Walter Pachl: > not really´!!! > The ELSE is NOT recognized as condition terminator: > /* REXX */ Trace R > a=1 > x=2 > y=3 > IF a = 1 THEN x = 2 ELSE y = 2 > Say x > Say y > 2 *-* a=1 > >>> "1" > 3 *-* x=2 > >>> "2" > 4 *-* y=3 > >>> "3" > 5 *-* IF a = 1 > >>> "1" > *-* THEN > *-* x = 2 ELSE y = 2 > >>> "0" > 6 *-* Say x > >>> "0" > 0 > 7 *-* Say y > >>> "3" > 3 > ---- Bill Fenlason<[hidden email]> schrieb: >> Note that in NetRexx, the following are all equivalent: >> >> IF a = 1 THEN x = 2 >> IF a = 1 ; THEN x = 2 >> IF a = 1 THEN ; x = 2 >> IF a = 1 THEN x = 2 ; > > >> IF a = 1 ; THEN ; x = 2 >> IF a = 1 ; THEN x = 2 ; >> IF a = 1 THEN ; x = 2 ; >> IF a = 1 ; THEN ; x = 2 ; >> >> and the 8 variations (for optional semicolons) for each of the following: >> >> IF a = 1 THEN >> x = 2 >> >> IF a = 1 >> THEN x = 2 >> >> IF a = 1 >> THEN >> x = 2 >> >> Similarly, the following are equivalent: >> >> IF a = 1 THEN x = 2 ELSE y = 2 >> >> IF a = 1 ; >> THEN ; >> x = 2 ; >> ELSE ; >> y = 2 ; >> >> as are all of the other arrangements on from 1 to 5 lines. >> >> Each element may occur on any line, and each is optionally followed by a >> semicolon. I count a total of 128 arrangements of the 5 elements in an >> IF-THEN-ELSE construct. >> >> In all of these examples, any of the assignment statements may be >> replaced by a DO - END, LOOP or SELECT instruction. In practice, there >> is often only a single instruction to be executed, and the complex >> instruction is not necessary. >> >> My point is that the independence of the placement of the parts of an IF >> construct is fundamental in NetRexx (and Rexx), and it cannot be limited >> without breakage. >> >> Attempting to introduce some form of the FORTRAN block IF will most >> likely not work in all of those situations. I would be more open to the >> idea of some kind of block IF construct if someone can show me how it >> would be compatible with all of the current (160) forms of the existing >> NetRexx IF construct. >> >> As George points out, the only viable approach would be the introduction >> of a new construct with new keywords, like BLOCKIF, ELSEIF and ENDIF. But >> >> BLOCKIF a = 1 THEN >> x = 2 >> ELSE >> y = 2 >> ENDIF >> >> is equivalent to >> >> IF a = 1 THEN DO >> x = 2 >> END >> ELSE DO >> y = 2 >> END >> >> The BLOCKIF structure is redundant, and with the goal of keeping the >> language simple, I think unnecessary. >> >> Adding a new instruction to avoid using DO-END is not justified, in my >> opinion. >> >> Bill >> >> >> On 11/21/2011 9:23 AM, George Hovey wrote: >> ... >>> You are well on the way to inventing the Fortran 77 Block IF >>> statement, except that the efficacy of that construct has been >>> established through more than 30 years of experience. This is a step >>> in the right direction :) . Your key insight, in my view, is the >>> realization that this construct need not impact NetRexx's current IF >>> statement, if new keywords are chosen, eg BlockIf, BlockElseIf, >>> BlockElse, BlockEnd. Of course this should have the same adornments >>> as the current IF (Label, Protect, exception handling, etc). Why >>> can't we learn from other languages? Must everything be Invented Here? >>> >>> > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ > > -- Thomas Schneider (Founder of www.thsitc.com) Member of the Rexx Languge Asscociation (www.rexxla.org) Member of the NetRexx Developer's Team (www.netrexx.org) _______________________________________________ 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 |
In reply to this post by billfen
Hi Bill,
it all DOES depend when and where we do consider an IF to be a STRUCTURED IF, or a SIMPLE IF: Simple IF: IF condtion THEN instruction Structured IF: IF condition [THEN] instructions END IF See at the Fortran 77 reference manuals for this important difference(s). Thomas. ========================================================================== Am 21.11.2011 22:50, schrieb Bill Fenlason: > On 11/21/2011 4:10 PM, George Hovey wrote: > ... >> P.S. Any comment on my notion that allowing IF to be labeled could >> improve the specificity of IF-error diagnostics? > > Since the IF instruction syntax begins "IF expression [;] ..." and > the DO, LOOP and SELECT instructions begin differently (with a > keyword, e.g. "DO LABEL name ...") there is a conflict between the > LABEL keyword and the expression in the IF expression. > > Thus "IF LABEL name boolVariable" would be ambiguous since "LABEL > name boolVariable" is also an expression using blank concatenation. > > This is a perfect example of the kind of situation Mike was guarding > against with his approach to keyword safety. If implemented, NetRexx > would first look for a variable named "LABEL", and if not found, > assume that LABEL is a keyword. As I've said earlier I'm not fond of > that approach, but C'est la vie. I don't think adding a labelled IF > statement to NetRexx is a good idea from a syntax viewpoint. > > Bill > > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ > > -- Thomas Schneider (Founder of www.thsitc.com) Member of the Rexx Languge Asscociation (www.rexxla.org) Member of the NetRexx Developer's Team (www.netrexx.org) _______________________________________________ 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 |
In reply to this post by Robert L Hamilton
FORTAN 77 did solve it to distinguinsh:
if (a) line1,line2,line3 *from* if (a) THEN statement **from ** the so called STRUCTURED IF Thomas. Am 21.11.2011 19:44, schrieb Robert Hamilton: 'course FORTRAN solved the problem w/: GOTO . . . --
Thomas Schneider (Founder of www.thsitc.com) Member of the Rexx Languge Asscociation (www.rexxla.org) Member of the NetRexx Developer's Team (www.netrexx.org) _______________________________________________ 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 |
Free forum by Nabble | Edit this page |