[J3] [EXTERNAL] Can a type-bound procedure be passed as an actual argument

Van Snyder van.snyder at sbcglobal.net
Thu Jan 12 22:27:40 UTC 2023


On Thu, 2023-01-12 at 09:55 +0900, Malcolm Cohen via J3 wrote:
> Type-bound procedures are invoked through an object. You can’t do
> that unless you have the object. Dynamic dispatch needs the object!
> ...
> It’s the same with generics (which are static dispatch); if the
> specific procedure name is not public, you cannot pass it as an
> actual argument.
Several years ago, I proposed a method to do generic resolution for a
generic procedure without invoking it, to assign the specific procedure
to a procedure pointer or use it as an actual argument.

A similar scheme could be used for dynamic dispatch, and to attach a
passed-object dummy argument, without invoking the procedure, to allow
it to be assigned to a procedure pointer or used as an actual argument.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.j3-fortran.org/pipermail/j3/attachments/20230112/3c6bd183/attachment.htm>


More information about the J3 mailing list