(j3.2006) (SC22WG5.5162) [ukfortran] [ Draft corrigendum 3]

Tom Clune Thomas.L.Clune
Sun Dec 22 11:30:48 EST 2013


Perhaps getting a bit off topic, but there _is_ one case of separating the attributes that I actually use routinely and regularly advise others to do so.  Namely, the PUBLIC attribute.   I find that a nice module style is to have a default PRIVATE statement followed by a list of the public entities.   Detailed specifications are further into the text.

Once a module has a number of nontrivial declarations (e.g. derived types), then the PUBLIC attribute an get a bit buried.  I want users of my modules to be able to tell at a glance which facilities are provided.   Of course this assumes that all of the public entities have names that are laden with clear intent.  As with many good practices, they rely and support other good practices.

Do others use this?   Does anyone have an interesting rebuttal?  Always looking to improve my style ?

Cheers,

- Tom


On Dec 22, 2013, at 4:54 AM, N.M. Maclaren <nmm1 at cam.ac.uk> wrote:

> On Dec 22 2013, Malcolm Cohen wrote:
>> 
>> I (and others) disagree with your assertion that
>>  REAL x(*)
>>  PARAMETER(x = [ 1,2,3,4,5 ]) is unreasonable and should never be 
>> allowed. Disallowing this would break one of our basic design rules for 
>> the BNF of declarations, which is that one can specify attributes 
>> independently. Yes it is a smaller edit to the standard, and would not 
>> remove significant functionality ... but then deleting the PARAMETER 
>> statement entirely would not remove significant functionality!
> 
> As someone who was not involved, I regrettably agree - though I think
> that Bill is right that such code IS unreasonable.  Introducing
> gratuitous restrictions should be considered only when they prevent
> actual, fairly common, mistakes.  I can't see one that this blocks.
> 
> As someone who teaches both Fortran and C++, I really appreciate the
> consistency and relatively tiny number of 'gotchas' of Fortran.
> Fortran syntax may be verbose and horrible, but it is clean and
> consistent (remember that I prefer Algol 68!)
> 
> I don't teach setting attributes separately but, if someone asks, I
> can simply say that I don't advise it but it can be done.  That's it.
> A couple of minutes, and it's covered.
> 
> 
> Regards,
> Nick Maclaren.
> 
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3

Thomas Clune, Ph. D. 					<Thomas.L.Clune at nasa.gov>
Chief, Software Systems Support Office		Code 610.3
NASA GSFC								301-286-4635
MS 610.8 B33-C128						<http://ssso.gsfc.nasa.gov>
Greenbelt, MD 20771





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.j3-fortran.org/pipermail/j3/attachments/20131222/c8df0e90/attachment-0001.html 



More information about the J3 mailing list