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  1998

COMP-FORTRAN-90 1998

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: MODULE and naming strategies

From:

"Dr W.W. Schulz" <[log in to unmask]>

Reply-To:

Dr W.W. Schulz

Date:

Mon, 2 Feb 1998 13:09:33 +0000 (GMT)

Content-Type:

TEXT/PLAIN

Parts/Attachments:

Parts/Attachments

TEXT/PLAIN (90 lines)

Arthur and Philip have started to talk about some important
topics on modules.
In my view there are several shortcomings of modules that
need to be addressed.

-smart compilation: also avoiding compilation cascade, separation
 of interface and implementation. The latter is strongly argued for
 by Van Snyder (see his proposal 98-104,105,106 on the F2000 website
 http://www.ionet.net/~jwagener/j3/index.html)
 My view is somewhat different. This issue is and should remain a compiler
 problem. The code contains all the necessary information to construct
 the public interface which the compiler can use to check and determine
 whether the interface has been changed. The user should not be bothered
 to write an extra interface which will add to the workload and be
 error-prone. Interface checking is a perfect job for an automatic tool.
 I hope the compiler vendors are listening. This is 1998 and I don't see
 why we should not expect these kinds of management tools.

-encapsulation: modules provide only a very rudimentary way of
 protecting/hiding implementation details. Some of this applies to
 TYPEs as well.

 a) indirect use of modules
    MODULE Y
       USE X
       ...
    END MODULE Y
    MODULE Z
       USE Y
       ...
    END MODULE Z
    Now Z has also access to MODULE X (and W and V and ...) without
    saying a word. Only an explicit and global PRIVATE in MODULE Y
    will prevent this access cascade.
    (BTW this PRIVATE is a requirement in the F90 subset F.)
    This access rule is a very unfortunate default rule. The consequences
    for name conflicts are obvious.

 b) Unlike other languages like ADA95, Java, etc that also employ
    modules Fortran does not have a mechanism to qualify the
    procedures and variables used from modules.
    ADA uses WITH <module> which requires qualifying the used feature
    with the module name while an additionalUSE <module> allows to
    skip this, useful when only one module is used or is used a lot.
    This certainly takes care of naming problems.

 c) Privileged Access to internal and private details.
    This becomes very important for larger or more complicated codes.
    Fortran allows only PUBLIC or PRIVATE but does not provide anything
    more fine-grained. One could easily extend PRIVATE to PRIVATE(accesslist)
    where accesslist is a list of names of modules that have privileged
    access with the shortcuts PRIVATE(NONE) = PRIVATE, PRIVATE(ALL) = PUBLIC.
    PUBLIC/PRIVATE should become attributes of procedures as well instead
    of requiring an additional statement elsewhere in the module, e.g.

    FUNCTION, PRIVATE :: foo( args )

    This feature feature is also very useful for TYPEs,

TYPE, PUBLIC :: Person ! This refers to visibility outside module
Character, PUBLIC :: Name, First
Real, PRIVATE :: Age
END TYPE Person

    This would allow the programmer to give very fine-grained access
    control to other modules.

These features would also make it easier to develop some abstraction
levels in the code, starting with low-level modules which can only be
called in the next level but nowhere else, etc.

These issues become even more important in the context of object-oriented
programming in F2000 (see also my proposal 98-109 available in a day or
two from F2000 website).

Cheers,
WWS
-----------------------------------------------------------------------
| Werner W Schulz |
| Dept of Chemistry email: [log in to unmask] |
| University of Cambridge Phone: (+44) (0)1223 336 502 |
| Lensfield Road Secretary: 1223 336 338 |
| Cambridge CB2 1EW Fax: 1223 336 536 |
| United Kingdom WWW: |
-----------------------------------------------------------------------



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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