Is it possible to create a function with the same interface as the elemental intrinsic bessel_jn(n, x), where n is always a scalar and x may be an array? It looks like it is not possible. Why not?
In general that would be nice, but it introduces one serious limitation: elemental type-bound procedures. I would like to write something like
type :: Foo
procedure :: func => Foo_func
type, extends(Foo) :: Bar
real :: param
procedure :: func => Bar_func
elemental function Foo_func(self, x)
class(Foo) :: self
real :: x, Foo_func
elemental function Bar_func(self, x)
class(Bar) :: self
real :: x, Bar_func
But this would not work, because I would need to provide an array of self's.
Did I misunderstood something? Why shouldn't this be allowed?