(j3.2006) question about generic resolution

Bill Long longb
Wed Mar 24 13:05:59 EDT 2010



Aleksandar Donev wrote:
> On Wednesday 24 March 2010, Bill Long wrote:
> 
>
> 
> But before the technical, I do feel I need to comment on the flame war 
> bait:
>> \begin{OpEdComment}
>>     This situation points out the inherent weakness in the argument
>> "We should add feature xxx because I can't think of a reason not
>> to.". \end{OpEdComment}

I was not attempting 'flame bait' here.  This argument has been made 
many times in the past. Often the feature is not accepted. I just wanted 
to point out yet another reason to be skeptical.

> 
>> 1) Leave both features in, but modify the generic resolution rules
>> such that the ambiguity is resolved in favor of the Fortran 2003 rule
>> that allocatable dummy corresponds to allocatable actual.
> Or, as you commented later,
> 1a) Do 2 now and then later actually do the work to make generics 
> preference-based (something Kurt promissed to do when I first joined J3 
> but unfortunatelly he left before it got done).
> 

This seems like a reasonable solution.



>> 2) Delete the allocatable .vs. pointer distinguishing of dummy
>> arguments feature.


> 
> I add my own preference:
> 
> 4) Modify the ruls so that one cannot write a generic like this. For 
> example, do not allow "pointer, INTENT(IN)" (caps serve an emphasis 
> purpose here) and "allocatable" to be used for disambiguation. The uses 
> of pointer-vs-allocatable feature I can think of, such as memory 
> management routines, would have INTENT(INOUT) pointer dummies, since 
> they would actually do something with the pointer. Otherwise simple 
> "temp pointer" on the caller side would do the trick.
> 
> and other options include, but are likely not limited to,
> 
> 5) Make the auto-targetting feature (mentioned in #3) only work with 
> non-generic calls.
> 

These are specifically targeted at fixing the current problem. They 
would work, but I think the edits for 1a) above would be easier (lower 
risk) changes to N1814 for now.

Cheers,
Bill



> Best,
> Aleks

-- 
Bill Long                                           longb at cray.com
Fortran Technical Support    &                 voice: 651-605-9024
Bioinformatics Software Development            fax:   651-605-9142
Cray Inc./Cray Plaza, Suite 210/380 Jackson St./St. Paul, MN 55101





More information about the J3 mailing list