Standard Compatibility [was: Re: New Alpha]_(re)

Thu, 3 Apr 1997 10:35:05 -0800 (PST)



>> And to ask a furthur question, why should
>> {-------------snip--------------}
>> for i := 1 to 5 do write(a[i]);
>> writeln;
>> {-------------snip--------------}
>> produce output for which you can not distinguish the elements of a?
>> 
>...
>
>We are talking about the default behaviour. i.e. the parameter next to 
>double-dot is missing. And we are talking abount write(integer), aren't
>we? 

Sorry, I was not clear.  a would be an integer array.  So yes, I was talking
about write(integer).  Which would default to write (integer:1) for Borland
and write(integer:10) (or some other number) for "traditional" Pascals.

So in the above example if a had the values 15, 23, 3, 42, 5, under Borland
your output would be "15233425" and you would have no clue as to what the
actual values in the array a really were.

>You are right, but declaring Default-TotalWidth(integer)=0 (or 1)
>conforms 
>to 6.10.3.3, the output will be a left aligned number, so we can beat
>"quasi" borland-compatibility and your need of standard-conformance.

True.  The default of 1 does follow the standard here as written.  This one
place where I feel the standard was not specific enough.  I believe that
the above code should produce output where you can distinguish the elements
of array a when a contains either integers or reals.  To do this, the standard
field width MUST be implementation dependent due to the number of digits
in the maximum integer.

>Once again: WHY NOT, why should it be defined to 5, 8, 10 or whatever 
>value you want? from 6.10.3.1 "the default values shall be

It should not be arbitrary!  It should be large enough so MAXINT will
have at least one blank in the field.  So in this case, gpc should have
the numbers depend on the MACHINE data type.  Choose something like
the number of digits in MAXINT + 1 to be the default integer field size.

-- 
Phil Nelson                       NetBSD: http://www.netbsd.org
e-mail: phil@cs.wwu.edu           LPF: http://www.lpf.org
http://www.cs.wwu.edu/~phil       !gifs: http://www.lpf.org/Patent/Gif/Gif.html


Phil Nelson (phil@cs.wwu.edu)

HTML conversion by Lluís de Yzaguirre i Maura
Institut de Lingüística Aplicada - Universitat "Pompeu Fabra"
e-mail: de_yza@upf.es