C Wishes

James A. Mullens jcm at ORNL-MSR.ARPA
Sun Nov 3 06:55:02 AEST 1985


Someone Said:
>>	5. There are various parts of the syntax that I don't like:
>>		2. ;'s as statement terminators, I prefer the algol statement
>>		   separator.
> I disagree; I prefer ;'s as statement terminators.  Trying to look at it
> objectively, I can see very little reason to prefer one or the other.

Firstly, this sounds a topic that could have been covered in infinite
detail in earlier discussions.  I would honestly appreciate some life
forms or C wizards editing and organizing the archives topically,
indexing the discussions under the appropriate K&R or standards
document section, i.e.  K&R 3.1 for discussions of ";".  If this
archival document could be stored in easily-printed form it might even
be a C Corcerer's Classic, or at least a substantial tool which
Corcerers can use to bludgeon Apprentices.  (Those not comfortable
with American, nota bene:  Corcerer is not in an English dictionary,
it is an abbreviation of C Sorcerer).

Secondly, my comments.  I don't see a major difference between
"statement separator" and "statement terminator" if ";"  is the only
symbol allowed to perform the separation.

However, I don't like the following use of ";"

  if (boolean_blah)
    true_action_blah ;
  else
    else_action_blah ;

I prefer letting (certain) keywords act as statement separators
in appropriate situations.  Id est,

  if (boolean_blah)        /* a Pascal-like syntax */
    true_action_blah
  else                     /* here else is a separator */
    else_action_blah;

when an else-clause is used, and

  if (boolean_blah)        /* a Pascal-like syntax */
    true_action_blah;

when an else-clause is not.

Finally, it _seems_ redundant to require a ";" before a "}".  Is it
true that the only time ";" does not preceed "}" in an executable
(non-declaration) statement is when "}" is preceeded by another "}"?
The "}" keyword should be considered a separator a la ";" .

Disclaimer:  This is the opinion of a C novice who knows more about
Pascal/FORTRAN/LISP/6502/6800/Z80/8088/PDP-11/68000, and likes Pascal
to boot.
-- 

Jim Mullens
615/574-5564
ARPA: jcm at ornl-msr



More information about the Comp.lang.c mailing list