At 05:26 PM 5/8/2001 +0200, Jan van Oosterwijk wrote:
>At 10:53 26-04-2001 +0200, some list member wrote:
> >On Thu, 26 Apr 2001, Michael Metcalf wrote:
> >
> >> Message text written by Fortran 90 List
> >> >By the way, what is the reason for the restriction to integers?<
> >>
> >> Because binary, octal and hexadecimal values may be stored, via a DATA
> >> statement, only in integers ("Fortran 90/95 Explained", Section 2.6.1).
> >
> >Well, but this only changes the question, doesn't it?
> >Why "binary, octal and hexadecimal values may be stored, via a DATA
> >statement, only in integers"?
>
>All the following discussion din not answer my question:
>
>Why is BOZ notation restricted to DATA statements.
>Isn't the initialization in a type decl stmt equivalent to DATA?
>
>I would like to be able to write
>
> Integer :: Q = Z'00ff00ff'
>
>or even
>
> Integer, parameter :: Q = Z'00ff00ff'
>
>if I want a mask of some sort.
I believe this restriction was the result of conflicting expectations in
certain related cases. Consider
X = B'101'+1.0
On some systems, B'101' would be seen as a another way of writing the
integer value 5, so X would receive the value 6.0. On other systems,
B'101' would be interpreted as the bit pattern for a floating point number
(typically, a value very close to 0.0), so the value of X would be 1.0 or
very close to it.
If X3J3 had chosen one or the other of these interpretations, vendors who
had previously implemented the other would be forced to make their F90
compilers incompatible with their F77 compilers, "breaking" existing user
programs, .... Instead, X3J3 chose to make these cases nonstandard, so
vendors could continue to implement whichever interpretation their
customers would expect.
It might have been possible to disallow these contentious cases and still
allow the cases you want, but that dividing line would have been more
difficult to describe, so X3J3 went with the restriction to DATA statements.
-Kurt
--
Kurt W Hirchert [log in to unmask]
UIUC Department of Atmospheric Sciences +1-217-265-0327
|