type(macroInLib) is now 11 instead of 13. type()==11 (uncompiled function) has been undocumented while it is still active
Reported by Samuel GOUGEON (@sgougeon)
BUG DESCRIPTION:
----------------
type()==11 (uncompiled function) has been undocumented while it is still active:
Removal: http://gitweb.scilab.org/?p=scilab.git;a=commitdiff;h=d168bfdb8088da44bfd5adca0d117b502f66cd3e#patch24
While
--> clear dec2bin
--> type(dec2bin) // unloaded
ans =
11.
--> dec2bin(123); // loading it
--> type(dec2bin)
ans =
11. // same type
--> exec("SCI/modules/elementary_functions/macros/dec2bin.sci",-1)
Warning : redefining function: dec2bin . Use funcprot(0) to avoid this message
--> type(dec2bin)
ans =
13.
This is a problem, because testing only against 13 with "if type(object)==13" now misses all functions in libraries.
The type==13 comes only if we exec() the source file.
ERROR LOG:
----------
HOW TO REPRODUCE THE BUG:
-------------------------
help type //
clear dec2bin
type(dec2bin)
dec2bin(123);
type(dec2bin)
exec("SCI/modules/elementary_functions/macros/dec2bin.sci",-1)
type(dec2bin)
OTHER INFORMATION:
------------------
In scilab 5, functions from libraries have a type==13. In Scilab 6, they get the 11 one.
Is this change expected? If yes: It is not documented in CHANGES og 6.0.0-b2
-->getversion
ans =
scilab-5.5.2
-->clear dec2bin
-->type(dec2bin)
ans =
13.