On 2010-01-26 16:51, Graeme Geldenhuys wrote: > David W Noon wrote: >> > >> > [snip] >>> >> case p of >>> >> '1': do_1; >>> >> '2' if (q > 0) then do_2; >>> >> else do_3; >>> >> end; >>> >> >>> >> It is not clear if else should be part of branch '2' (part of if >>> >> statement), or else branch for case. >> > >> > A quick examination of Jensen & Wirth's original Pascal grammar will >> > tell you how that should be parsed: in Pascal there is *never* a >> > semi-colon between the "then" clause and the "else" in an "if" >> > statement. > I must agree with David. The idea of the extra semi-colon just adds > confusion and no extra value. > > Example where 'do_3 is part of the case statement: > case p of > '1': do_1; > '2' if (q > 0) then do_2; > else do_3; > end; > > > Example where 'do_3' is part of the '2' if/else statement: > case p of > '1': do_1; > '2' if (q > 0) then do_2 > else do_3; > end; > > > Syntax and understanding is as clear as rain. Adding extra semi-colon, as > you suggested, is not. > > As for the 'otherwise' syntax. You are correct, I have never heard or seen > it before. :-) But it is documented in the FPC Language Reference section > 10.2.2. > > Regards, > - Graeme - > I believe `otherwise' was in VAX/VMS Pascal in the early 80's, which, I must say, was a Pascal implementation way ahead of its time, including the passing of dynamic arrays, and much more.
Regards, Arnstein. -- ---------------------------------------------------------------------------- Arnstein Prytz arnstein.pr...@jcu.edu.au Australian Coastal Ocean Radar Network ph: 61-7-47815565 Marine Geophysical Laboratory James Cook University Townsville, Queensland 4811, Australia ---------------------------------------------------------------------------- _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel