Newsgroups: comp.lang.fortran
From: nos...@see.signature (Richard Maine)
Date: Mon, 9 Apr 2007 09:57:06 -0700
Local: Mon, Apr 9 2007 12:57 pm
Subject: Re: Transfer and variables that don't use all their storage space.
James Giles <jamesgi...@worldnet.att.net> wrote: I need to use a temp variable to get the effect. First, I claim that > Richard Maine wrote: > > That sentence > > specifically says what some cases give as a result, and it says it in > > a fashion that is not system dependent. > Well, I've thought it over again and I can't see any difference > between passing transfer(transfer(E,D),E)) as an actual argument > and just passing E as the actual argument except the following: > the result of TRANSFER may not be argument associated > with a dummy argument that has OUT among its INTENTs. > I don't see how that difference could cause "havoc". So, at > least as far as the issue of ALLOCATABLE components, > I still see no problems. introducing an intermediate variable cannot change the standard's claim that transfer((transfer(e,d),e) must return E. If that made a difference, then that would mean that the result of transfer was somehow not captured in its value. In particular, if we change it to d = transfer(e,d) This is for a case where D is of a "benign" type where the assignment So do d = transfer(e,d) where ee is another vairiable of the same type as e. I probably don't subroutine sub(ee,e) I can imagine a fair chance that the allocatable components of e and ee That's just a pretty much off-the-top-of-my head example. It is slightly Once you have a single "hole" like this, you can open up many others. > For You have *GOT* to be kidding. :-) Yes, I saw that you labelled it as > all we know, someone in the F90 committee carefully thought > through all possible cases and found no "havoc" arising from > any of them. speculation. But I don't even think it is very plausible speculation. I've seentoo much of the committee close up; I don't think they would have thought through all the cases of that one, particularly as... > That's speculation too (unless someone remembers "All these years" isn't very many for allocatable components, which are > it). It seems as likely as that there *is* a problem with the > requirement that no one can identify after all these years. where I can most readily see a related problem. Wouldn't surprise me if there are others, but that's one I think I can see concretely. There's no way that whoever wrote the transfer description for f90 could have carefully considered how it worked with allocatable components, the details of which weren't done til a decade later. I was there during all of the work on allocatable components, and I don't recall any such topic relating to transfer ever having been broached. I do recall that allocatable components had lots and lots of subtleties that took a long time to work out, both in the standard and in implementations. They seem like such a simple and "obvious" thing that many people don't see why they took so long. There was a time when I didn't appreciate the issues. My first attempts at f90 code, before I had a compiler to check me, used allocatable components because I just assumed that, of course, you could do that since you had allocatables and you had components. -- 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.
| ||||||||||||||