X3J11 thoughts (function arguments)

Andrew Klossner andrew at orca.UUCP
Fri Aug 10 04:59:06 AEST 1984


> >                   Thus they removed the possibly useful effects of an
> >Algol 60 style of general use (which we also have in C, of course) - you
> >can't count with a var parameter or a global.  Yet they failed to provide
> >the useful clarity and optimizability of a completely local ALGOL 68 style
> >of controlled variable.
> Since clarity is strictly subjective, I can't respond to that point in an
> objective fashion.  In my experience, the clarity of the Pascal design is
> sufficient to be useful.  The optimizability is no less than that of ALGOL 68,
> since the restrained control-variable approach of Pascal is, in the respects
> that matter, indistinguishable from the local approach.

Algol 68 is still more optimizable.  Since the index variable is
strictly local to the loop, it can be held in a register and not
assigned a memory location, as its value upon loop termination is not
available.  In Pascal, it is much more difficult to assign a register
to the index variable, since its scope is the entire block, and so,
even if computations are maintained in the register, the computed value
must be stored to memory so as to be available outside the loop.

However, I agree that making a change of this magnitude to Pascal would
have been inappropriate.  The Algol 68 committee had the luxury of
designing a language for which there were no existing programs (once
they decided not to pursue compatibility with Algol 60).

  -- Andrew Klossner   (decvax!tektronix!orca!andrew)      [UUCP]
                       (orca!andrew.tektronix at rand-relay)  [ARPA]



More information about the Comp.lang.c mailing list