Dear Statalist
I have written a Mata function that accepts a pointer to a function. The code works fine with user-written functions, but i receive an error when referring to built-in functions, e.g.:
dofunc(x,&sum())
since "&sum()" returns a null pointer. I have also tried using findexternal, e.g.,
findexternal("sum()")
but this also returns a null pointer. Is there any way to pass a built-in function to a mata function?
Thanks in advance,
Barth
I have written a Mata function that accepts a pointer to a function. The code works fine with user-written functions, but i receive an error when referring to built-in functions, e.g.:
dofunc(x,&sum())
since "&sum()" returns a null pointer. I have also tried using findexternal, e.g.,
findexternal("sum()")
but this also returns a null pointer. Is there any way to pass a built-in function to a mata function?
Thanks in advance,
Barth
Comment