Invalid analogy

William Thomas Wolfe, 2847 billwolf%hazel.cs.clemson.edu at hubcap.clemson.edu
Sun Mar 4 07:11:54 AEST 1990


>From eaker at sunbelt.crd.ge.com (Charles E Eaker):
>>   [In C] similar flow-of-control constructs do not terminate in 
>>   similar ways.  If one is using the if statement, termination is
>>   automatic.  If one is using the switch statement, a break is required.  
> 
% [An invalid analogy is attempted:]
%    "LOOP" construct, which contained
%       a "CASE" statement, which contained 
%          an "IF" clause, which contained an
%             "EXIT," which was intended for
%          the "IF" clause, but instead broke from
%       the "LOOP" statement.

   Notice: "similar flow-of-control constructs".  Both the case and 
   the if statements execute different sections of code depending on
   the value of a controlling expression.  A loop is a flow-of-control
   construct, but not one which is similar to the if or case constructs,
   which are so closely related that one is a special case of the other. 

   This extreme similarity, unfortunately, does not extend to C's concept
   of how the two should be supported within the programming language. 


   Bill Wolfe, wtwolfe at hubcap.clemson.edu
 



More information about the Comp.lang.c mailing list