Newsgroups: comp.lang.fortran
From: "James Giles" <jamesgi...@worldnet.att.net>
Date: Mon, 09 Apr 2007 04:42:18 GMT
Local: Mon, Apr 9 2007 12:42 am
Subject: Re: Transfer and variables that don't use all their storage space.
Richard Maine wrote: There are a lot of things that can cause havoc. I think the committee > James Giles <jamesgi...@worldnet.att.net> wrote: ... >> The internal representation of ALLOCATABLE components >> of a derived type would almost certainly be very similar to the >> internal representation of a POINTER component.... >> What TRANSFER would >> operate on would be the implementation dependent bits of >> such a hidden descriptor. > Yes, that's what I would expect. *HOWEVER*, if you transfer the bits > Yes, I can imagine what I'd expect to happen in practice, based on probably envisioned that abuse of TRANSFER would cause havoc. Everything about TRANSFER is implementation dependent. So, its not even possible to discuss the havoc (except speculatively) without stating what implementation you're talking about. The semantics of TRANSFER are defined in terms of *representations* and not *values*. The fact that the resulting *values* are meaningless (the LOGICAL result transferred from INTEGER, for example) or even dangerous (multiple ALLOCATABLE components associated with the same storage) is the programmer's responsibility. Still, I don't see the ALLOCATABLE components problem as all var = transfer(transfer(E, D), E) Where E and VAR are both some derived type and D is some type -- "I conclude that there are two ways of constructing a software 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.
| ||||||||||||||