whereis("my_user_defined_fun") returns [] and expects a function handle, unlike for macros in libraries and primitives in gateways
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
For macros registered in libraries or primitives registered in gateways,
whereis() can process equivalently the handle or the text name of the function:
--> whereis("sin")
ans =
elementary_functions
--> whereis(sin)
ans =
elementary_functions
--> whereis("sind")
ans =
elementary_functionslib
--> whereis(sind)
ans =
elementary_functionslib
When documenting whereis() @ https://codereview.scilab.org/#/c/19399/,
I am 90% sure that it was also the case for user-defined functions
(i could scan my sessions logs), and it was documented as is.
But it is no longer the case in Scilab 6.0.1:
function test(), disp("test"), endfunction
whereis(test) // OK
whereis("test") // => [] : NOK
--> whereis("test") // OK
ans =
[]
--> whereis(test) // => [] : NOK
ans =
script
If i am wrong about the history and it was never the case, then extending whereis() in order to match its behavior with registered macros and primitives would make it more regular, less puzzling.
ERROR LOG:
----------
none. wrong answer
HOW TO REPRODUCE THE BUG:
-------------------------
function test(), disp("test"), endfunction
whereis("test")=="script"