JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for COMP-FORTRAN-90 Archives


COMP-FORTRAN-90 Archives

COMP-FORTRAN-90 Archives


COMP-FORTRAN-90@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Monospaced Font

LISTSERV Archives

LISTSERV Archives

COMP-FORTRAN-90 Home

COMP-FORTRAN-90 Home

COMP-FORTRAN-90  2003

COMP-FORTRAN-90 2003

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: Extends keyword in F2k

From:

David LaFrance-Linden <[log in to unmask]>

Reply-To:

Fortran 90 List <[log in to unmask]>

Date:

Mon, 22 Sep 2003 11:07:22 -0400

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (77 lines)

   Date: Sat, 20 Sep 2003 08:43:01 +0800
   From: Daniel Grimwood <[log in to unmask]>

   Yeah ok. It would be nice but I don't know how much effort it would be
   for compiler vendors and the standards guys. The main reason I was saying
   that we could have multiple parents while disallowing common grandparents
   is that it is a reasonably trivial change to the standard. As David said,
   this may not be multiple inheritance, but it's a lot more useful than what
   the draft has now.

That ["a lot more useful"] is not at all clear. There is a difference
between utility and usefulness. Utility is about capabilities, which
doesn't judge ease of use. Usefulness is a combination of things
including a comprehensible conceptual model. Single-inheritance
(Java, F2K, Smalltalk) is a simple conceptual model.
Single-instance-of-grand*parent multiple inheritance (CommonLisp) is a
slightly more complicated conceptual mode, and the rules imposed on
the DAG are largely intuitive. Let-the-user-decide-(BEWARE!) of C++
is a much more difficult conceptual model. What makes it particularly
tricky is that non-virtual (direct) inheritance is much more efficient
at runtime, and if you get direct inheritance because you *forgot* the
'virtual' keyword and you accidentally end up with multiple
grandparents when only one was intended, you're in for a nasty
debugging session. Granted, a multiple-inheritance-never-shared model
looks conceptually simple, but the never-shared part can complicate
the model pretty quickly.

The basic idea of inheritance is an "IS A" relationship. (Fields,
members, components, whatever the jargon of a particular language, is
a "HAS A" relationship.) The philosophical question is: If something
IS AN Object, isn't it a single Object? Wouldn't it be the equivalent
of a multiple-personality disorder if it were a different Object via
different perspectives?

To make a small case shared inheritance, consider writing a portable
extensible multi-lingual debugger. Consider how it represents types
of a particular vendor's language, say Digital's F90 for Alpha/Tru64.
(OK, I wrote such a debugger... and this is somewhat of a legacy
platform now, so I don't think I'll offend anybody.) Consider (using
F77's terminology) INTEGER*4. I claim the following "IS A" statements
are valid (read INTEGER*4 as bound to Digital Alpha/Tru64 F90):
 -- INTEGER*4 IS A Fortran integeral type (so is integer*2)
              IS A Fortran non-complex type (so is real*4)
              IS A Fortran numeric type (so is complex)
              IS A Fortran type (so is character)
           !! IS A language type (so are C types)
           !! IS A type
           !! IS AN object
 -- INTEGER*4 IS AN integral type
              IS A rational type (so are ratios)
              IS A real type (so are
              IS A numeric type
           !! IS AN abstract type
           !! IS A type
           !! IS AN object
 -- INTEGER*4 IS A 32 bit fixed-size integer type (so is 16 bit)
              IS A fixed-size type (so is ieee floats)
           !! IS A manifest type (so is variable)
           !! IS A type
           !! IS AN object
 -- INTEGER*4 IS A little-endian type
           !! IS A manifest type (so is big endian)
           !! IS A type
           !! IS AN object
The statements with a double !! show the higher level categories I
decided on for organization. The first is the language perspective,
the second is the abstract perspective, and the third&fourth are the
representaiton perspective(s). They all participate in what an
INTEGER*4 "IS" and how it behaves. In the end, it IS A type, no
matter which of the four direct ways through the DAG you go, or the
dozens of other ways (e.g., A fortran non-complex type is also an
(abstract) real type, just to name one).

Unfortunately for me, this uncovered several bugs in more than one C++
compiler. The workaround for one of those bugs was to delare more of
the inheritances to be virtual than technically needed to be!

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

December 2023
February 2023
November 2022
September 2022
February 2022
January 2022
June 2021
November 2020
September 2020
June 2020
May 2020
April 2020
December 2019
October 2019
September 2019
March 2019
February 2019
January 2019
November 2018
October 2018
September 2018
August 2018
July 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
December 2015
November 2015
October 2015
September 2015
August 2015
June 2015
April 2015
March 2015
January 2015
December 2014
November 2014
October 2014
August 2014
July 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
July 2013
June 2013
May 2013
April 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
August 2010
July 2010
June 2010
March 2010
February 2010
January 2010
December 2009
October 2009
August 2009
July 2009
June 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
January 2007
2006
2005
2004
2003
2002
2001
2000
1999
1998
1997


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager