Newsgroups: comp.lang.fortran
From: Brooks Moses <bmoses-nos...@cits1.stanford.edu>
Date: Sun, 08 Apr 2007 19:46:19 -0700
Local: Sun, Apr 8 2007 10:46 pm
Subject: Re: Transfer and variables that don't use all their storage space.
Richard Maine wrote: I mean "naive" in the sense of looking just at that paragraph, without > Brooks Moses <bmoses-nos...@cits1.stanford.edu> wrote: >> A naive reading of the double-transfer requirement would claim that, if >> E is some number other than 1 or 0, then the processor is required to >> feed that into D's storage space and leave it there, so that it can then >> be converted back into the same number by the outer transfer statement. >> In particular, according to this reading, the inner transfer statement >> cannot "normalize" the bit representation into one of the canonical >> LOGICAL forms, because then the outer transfer statement would return >> either 1 or 0, neither of which is equal to E. > I think I agree with that. I'm not sure what is naive about it. It is considering context or outside knowledge. I don't mean that I think it's necessarily wrong. >> I would contend that this reading is incorrect -- that, in particular, I think I'm confused as to what it means, in practical terms, when "the >> if E has a bit representation that is not one of the canonical bit >> representations for a logical variable, then the inner transfer >> statement is illegal according to the comments in the beginning of >> section 13.7 which state that a program is not allowed to invoke an >> intrinsic with arguments that produce out-of-range results. And further >> that the double-transfer identity requirement obviously is only meant to >> apply when both transfer calls, taken independently, are legal. > I agree, except with your comment that the para before is incorrect. standard ... requires disallowed behavior". I'm not sure how to write a compiler that disappears in a puff of logic in such cases! :) Perhaps it would be useful for me to elaborate a bit more on why I'm logical(kind=8) :: L (Note that, in GFortran, KIND=8 logicals and integers are 8-byte.) In order to do the initialization-expression handling to reliably Doing that would either require that the entire initialization- However, if this is illegal code, then I would think that it would be If I understand your above comments correctly, you've agreed that this Would it be allowable, at least, for a compiler to throw an error and - Brooks -- You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||