(j3.2006) question about assignment

Malcolm Cohen malcolm at nag-j.co.jp
Sun Mar 15 21:45:49 EDT 2009



Bill Long wrote:
> In a simple, intrinsic assignment
>
>   a = b
>
> is it required that b be defined?
To the extent that the value of B contributes to the value of A, yes.
>   It seems not always, since a and b
> could be structures with an allocatable component,
Right.  Maybe we should have revised that (it's up to us to say what 
"defined" means).  Maybe we should revise it in F2008, since a structure 
with a deallocated allocatable component act like they are defined.  
Maybe I should raise that last "maybe we should" to a "probably ought 
to"... the more I think about it the more I think it's wrong as is.  
04-007 p419 has the definition.
>  and there is a
> special case where the component of b being not allocated just causes
> the corresponding component of a to be not allocated.  However, the case
> where a and b are allocatable and of intrinsic type is not as clear.  If
> b is not allocated, is the assignment legal and a becomes not allocated,
> or is the assignment not legal?
>   
I see no words in 04-007 to allow that, furthermroe the words that are 
there don't make sense for an unallocated <expr>, so definitely not allowed.

Cheers,
-- 
.........................Malcolm Cohen, Nihon NAG, Tokyo.

(I should stop answering email and get back to typesetting, right?)




More information about the J3 mailing list