Re: Thou shalt have no other gods before the ANSI C standard

From: Peter Flass (Peter_Flass_at_Yahoo.com)
Date: 02/27/05


Date: Sun, 27 Feb 2005 14:18:41 GMT

Douglas A. Gwyn wrote:
> Douglas A. Gwyn wrote:
>
>> ... The PL/I example he posted was for a *known*
>> string length, which is much simpler to optimize.
>
>
> Also, somebody else pointed out that unlike C, in PL/I
> (and FORTRAN, at least the earlier versions) the loop
> step size and limit are specified as being computed
> before the loop starts. C has a more dynamic (thus
> more powerful) for-loop construct.

Not quite true. PL/I has the WHILE and UNTIL options of DO (differing
in whether the test is executed before or after the loop body).
You can say, e.g.
   DO i=1 BY 1 WHILE( i<=length(string) );
which is, I believe, just about exactly equivalent to:
   for ( i=0; i++; i<strlen(string) ) {
in that the conditional is executed every time through the loop.

It's not as common a construction, just because of the repeated
evaluation, but it's there if you want it.



Relevant Pages

  • Re: Big number modular math
    ... Douglas A. Gwyn wrote: ... 0<=y<n, but if y is in that range on entry to the whileloop, then c ...
    (sci.crypt)
  • Re: What math class to take to catch up on Modulus and DLP?
    ... Douglas A. Gwyn wrote: ... |> Normally flame wars arise from a breakdown in communication. ... | You were claiming that a design having just enough rounds to be ...
    (sci.crypt)
  • Re: Thou shalt have no other gods before the ANSI C standard
    ... Douglas A. Gwyn wrote: ... > BRG wrote: ... > C standards comittee but rather among the users. ...
    (sci.crypt)
  • Re: Public disclosure of discovered vulnerabilities
    ... Douglas A. Gwyn wrote: ... >Since it is unrealistic to expect fresh college graduates ... Mentoring and apprenticeship ...
    (sci.crypt)
  • Re: Implicit int
    ... And that was one of the PRIMARY reasons that made Microsoft make its buggy model. ... Douglas A. Gwyn wrote: ... And, if this is 80% of people, C implementation will want to keep backward compatiblity with these inept pieces of code, and the C standard will standardize this behavior, because it standardizes existing practice. ...
    (comp.std.c)

Quantcast