(j3.2006) Still illegal in F08?

Malcolm Cohen malcolm
Wed Jan 6 20:33:25 EST 2010

Van Snyder wrote:
> Everything about automatic variables is well-provided-for by allocatable
> variables and IF constructs.

I don't agree.  You don't need any IF constructs for what we currently consider 
to be automatic variables, and for very good reason.  Needing an IF construct 
marks your suggestion out as being different in kind from what we allow now.

> If there was a good argument for automatic variables, I don't understand
> why there aren't good arguments for making them more usable.

Well I don't think your suggestion would make them more usable at all.  To the 
extent that it waters down compile-time checkability, in fact it worsens the 
user experience.

The user has little control over the evaluation order of specification 
expressions and less over handling potential exceptional conditions that arise 
therein.  That is a very good reason for limiting specification expressions to 
the set of things that can be done relatively safely (barring the usual 
overflows and underflows).  Once you need to handle exceptional cases you are 
into the realms of IF constructs, and this is usually better handled in 
executable code.  (Mostly one wants to execute different statements if optional 
arguments are not present anyway.)

................................Malcolm Cohen, Nihon NAG, Tokyo.

More information about the J3 mailing list