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 > Re: Type extens...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 9 Topic 8550 of 8767
Post > Topic >>

Re: Type extension and renamed parent type

by nospam@[EMAIL PROTECTED] (Richard Maine) Jul 24, 2008 at 10:32 PM

Damian <damian@[EMAIL PROTECTED]
> wrote:

> On Jul 24, 10:50 am, Tobias Burnus <bur...@[EMAIL PROTECTED]
> wrote:
> > 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"...
> >
> > "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
> 
> For what it's worth, the IBM compiler interprets it the same way as
> the NAG compiler.  I'll be interested to hear from those who know the
> standard well enough to respond to your question.

Seems to me like the material you quoted makes it pretty explicit that
it should be the local name - that is to say that both compilers are
wrong. I would have thought that's exactly what the note was trying to
clarify. I can't see what else the note would be saying. Surely there
wouldn't be a note just to say that you can use a local name? That seems
obvious enough that if one doesn't get that, one probably needs a whole
lot more help than just the note. I would have thought that the note was
to clarify that when you use the local name, that is the "name of the
parent type" that is referred to elsewhere.

-- 
Richard Maine                    | Good judgement comes from experience;
email: last name at domain . net | experience comes from bad judgement.
domain: summertriangle           |  -- Mark Twain
 




 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 Sat Oct 11 12:47:10 CDT 2008.