(j3.2006) Why no Intrinsic Procedures in Defined Operators?

Craig Dedo craig
Thu Feb 23 19:04:25 EST 2012


Everyone:

            I would like to know why it is not permissible to use an intrinsic procedure
in a defined operator definition.  

 

            Today I noticed this constraint:

C1207 (R1206)  A procedure-name shall be a nonintrinsic procedure that has an explicit
interface.

 

In the Fortran 2003 Standard, the same constraint appears with the same number and
different wording, but which is semantically equivalent.

 

            It seems to me that it would be useful to define operators for some intrinsic
procedures.  E.g., I may wish to define a .Remainder. operator for the MOD() function or a
.Modulo. operator for the MODULO() function.  Some of the bit intrinsics also would be
good candidates for defined operators.

 

            With this constraint in place, I need to define wrapper functions for each
specific instance of each intrinsic function that I want to make into a defined operator.
E.g., if I want a .Remainder. operator, I would need to define 6 specific wrapper
functions for MOD() if I want to support 2, 4, and 8 byte integers and 4, 8, and 16 byte
reals.  I would then need to place references to those wrapper functions into a defined
operator interface.  Although not, difficult, this work-around is somewhat tedious.

 

            Could anyone shed some light on this?  What useful purpose would such a
restriction serve?

 

Sincerely,

Craig T. Dedo

17130 W. Burleigh Place

P. O. Box 423                         Mobile Phone:  (414) 412-5869

Brookfield, WI   53008-0423    E-mail:  < <mailto:craig at ctdedo.com> craig at ctdedo.com>

USA

Linked-In:   <http://www.linkedin.com/in/craigdedo> http://www.linkedin.com/in/craigdedo

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://j3-fortran.org/pipermail/j3/attachments/20120223/919a1f6c/attachment.html>



More information about the J3 mailing list