Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Fortran > Type extension ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 9 Topic 8550 of 8908
Post > Topic >>

Type extension and renamed parent type

by Tobias Burnus <burnus@[EMAIL PROTECTED] > Jul 24, 2008 at 10:50 AM

Hello,

Assume the following Fortran 2003 source:

MODULE M
  TYPE MOD_T
     INTEGER :: I
  END TYPE MOD_T
END MODULE M

use m, only: local => mod_t
type, extends(local) :: my_t
end my_t
type(my_t) :: my

Does "my" contain "my%local" or "my%mod_t" ?

According to NAG f95 it is "my%mod_t". I tried to read the Fortran
standard, but I cannot get to a definite conclusion. Reading only
"4.5.6 Type extension" I got the impression that "my%local" is
correct. However, reading "11.2.1 The USE statement and use
association", I'm not sure whether the parent name really changes or
whether "local" is merely a "local identifier" for "mod_t" and thus
the parent name stays "mod_t". Can someone help me with reading the
standard?

"The parent type of an extended type is the type named in the EXTENDS
attribute specification."
"NOTE 4.49 The name of the parent type might be a local name
introduced via renaming in a USE statement."
"An extended type has a scalar, nonpointer, nonallocatable, 1 parent
component with the type and type parameters of the parent type. The
name of this component is the parent type name."

Tobias
 




 9 Posts in Topic:
Type extension and renamed parent type
Tobias Burnus <burnus@  2008-07-24 10:50:56 
Re: Type extension and renamed parent type
Damian <damian@[EMAIL   2008-07-24 20:41:27 
Re: Type extension and renamed parent type
nospam@[EMAIL PROTECTED]   2008-07-24 22:32:33 
Re: Type extension and renamed parent type
paul.richard.thomas@[EMAI  2008-07-26 23:22:33 
Re: Type extension and renamed parent type
nospam@[EMAIL PROTECTED]   2008-07-26 23:44:32 
Re: Type extension and renamed parent type
Ron Ford <ron@[EMAIL P  2008-07-27 22:28:16 
Re: Type extension and renamed parent type
nospam@[EMAIL PROTECTED]   2008-07-27 22:05:17 
Re: Type extension and renamed parent type
paul.richard.thomas@[EMAI  2008-07-28 06:00:22 
Re: Type extension and renamed parent type
Ron Ford <ron@[EMAIL P  2008-07-28 13:39:05 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Nov 19 8:57:05 CST 2008.