(j3.2006) Would there be a technical problem if...

Bill Long longb
Wed Jan 17 10:11:49 EST 2018


> On Jan 17, 2018, at 8:54 AM, Damian Rouson <damian at sourceryinstitute.org> wrote:
> 
> Such a feature would be especially nice for use with type-bound operators:
> 
> type(vector_field) : u(3), v(3), w(3)
> u = v .dot. w
> 

I don?t find this example persuasive. Firstly, the obvious way to do something like this is to define the operator generic in the module where the type is defined and supply the implementation function in the same module.  I don?t see how this example has anything to do with OOP or type-bound procedures.  For simple computations, tbp are almost always the wrong choice for performance.  I hope people are not being taught to do things like this.   Finally, I would expect an operator named .dot. to have a scalar result. 

Cheers,
Bill

> 
> Damian
> On January 16, 2018 at 7:25:51 PM, Van Snyder (van.snyder at jpl.nasa.gov) wrote:
> 
>> We require the passed-object dummy argument to be scalar. 
>> 
>> Would there be a technical problem if it were allowed to be an array, at 
>> least in the case it has INTENT(IN)? 
>> 
>> I tried to create a generic "dump" binding that would dump a scalar, 
>> using a type-bound routine with a scalar passed-object dummp argument, 
>> and another one with a rank-one passed-object dump argument. The array 
>> dump just iterated over the elements and called the scalar one. 
>> 
>> 
>> _______________________________________________ 
>> J3 mailing list 
>> J3 at mailman.j3-fortran.org 
>> http://mailman.j3-fortran.org/mailman/listinfo/j3 
> _______________________________________________
> J3 mailing list
> J3 at mailman.j3-fortran.org
> http://mailman.j3-fortran.org/mailman/listinfo/j3

Bill Long                                                                       longb at cray.com
Principal Engineer, Fortran Technical Support &   voice:  651-605-9024
Bioinformatics Software Development                      fax:  651-605-9143
Cray Inc./ 2131 Lindau Lane/  Suite 1000/  Bloomington, MN  55425





More information about the J3 mailing list