_envListInPkg
Return a list of a package content
Thus, all functions, all types and all global variables are returned.
About types, even created with struct or typedef are returned.
About functions, even in a struct or a typedef (fields definition)
are also returned.
Prototype :
fun [Chn S] [[S S I] r1]
- Chn : any channel. If nil, nil will be returned.
- S : a package filename
Return : [[S S I] r1] A list of all items. For each item :
- S : the name (of the function, type, etc). By example "_openchannel".
- S : its type (nothing for a type). By example : "fun [S S Env] Chn".
- I : the arity (the number of arguments for a function) : negative
for a type, a Scol constante or a global variable (in this last case : nil).
By example : 3
It returns nil if error or package not found in this channel.
Error :
- EOK if no error.
- EARGNIL if the package file name is nil.
- ECHN if the given channel is nil.
- ENOFOUND if the package is not found (in the given channel).
- EVM if a memory error occurs. The VM will exit and more informations
could be found in the log file (if activated in the debug mode level).
See also :
Example :
fun printEnv (l)=
if l == nil then
0
else
(
_fooS sprintf "name = %s type = %s arity = %i pkg = %s" hd l;
printEnv tl l
);;
fun main ()=
_showconsole;
printEnv _envList _channel;
0;;
Note :
The local variables are not returned (this is logic ...).
WARNING : this function can take a long time before return.
The list size could be greater than thousands of elements.