(j3.2006) Chaining type-bound procedure references

Tom Clune Thomas.L.Clune
Wed Apr 30 14:20:41 EDT 2014

On several occasions, and today in particular, I have encountered the situation where it would be clearer (and definitely easier) to implement an algorithm in the following fashion:

val = obj % method1() % method2()

Here method1() returns some object, and method2() is bound to class of that object.   And I realize of course that the language does not (currently) permit anything like this.

I can guess that there are some inherent ambiguities that make my syntax above non starters, though I cannot readily think of what the are.  But what concerns would there be, if any, for either of the following forms:

Option 1:   Parens to force intermediate ("annonymous" object)

val = (obj % method1()) % method2()

Option 2:  Permit a new special operator ("->") that could be overloaded for this purpose:

val = obj % method1() -> method2()

BTW, I would be fine with the constraint that the anonymous object must be CLASS(?), POINTER   if that makes a difference on the implementation side.

For now, my question is simply whether there is something inherently flawed in any attempt to achieve such chaining of operations?  Or would it be more a matter of refinement and priority?   (I'm assuming others have already considered this issue, and would not otherwise assume it could be answered easily/quickly.)


- Tom

Thomas Clune, Ph. D. 					<Thomas.L.Clune at nasa.gov>
CISTO	Code 606.0
NASA GSFC								301-286-4635
MS 610.8 B33-C128
Greenbelt, MD 20771

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.j3-fortran.org/pipermail/j3/attachments/20140430/563de01e/attachment.html 

More information about the J3 mailing list