Re: [Scilab-users] clearing macros of a library
Hello Jean-Yves, Le 15/02/2022 à 17:27, Jean-Yves Baudais a écrit : Bonjour, Is there a simple way to clear all the used functions of a given library, because unloader.sce only remove the library from the "who" list, but not the functions that have already been used and that stay in memory, unfortunatly! Yes, this way: --> clear(string(mylib)(2:$)) Should we actually clear also macros belonging to the library, in the default unloaded.sce script? There is currently an explicit warning in comment: "This does not unregister its macros" I think it would be cleaner. But there may be some reasons to not having done it... Samuel ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
[Scilab-users] unloader.sce
Bonjour, Is there a simple way to clear all the used functions of a given library, because unloader.sce only remove the library from the "who" list, but not the functions that have already been used and that stay in memory, unfortunatly! Thanks, -- Jean-Yves Baudais ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] unloader.sci & module.quit
Le 15/02/2022 à 20:24, Samuel Gougeon a écrit : .../... * If the module to unload is an autoloaded ATOMS module, its library is protected. Then trying to clear it yields an expected error. The default unloader.sce does not take this into account. Yet, it should avoid or handle the error without stopping. Actually, the error is caught, but prevents unloading the documentation and preferences. Maybe it's better in this way (unload all parts of the module, or none of them). ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] clearing macros of a library
> --> clear(string(mylib)(2:$)) Thanks! It does what I expected. > Should we actually clear also macros belonging to the library, in the default > unloaded.sce script? > There is currently an explicit warning in comment: " This does not unregister > its macros" > I think it would be cleaner. But there may be some reasons to not having done > it... For my Scilab understanding, what are the reasons? Thanks, --Jean-Yves ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users
Re: [Scilab-users] unloader.sci & module.quit
Le 15/02/2022 à 19:03, Jean-Yves Baudais a écrit : --> clear(string(mylib)(2:$)) Thanks! It does what I expected. Should we actually clear also macros belonging to the library, in the default unloaded.sce script? There is currently an explicit warning in comment: " This does not unregister its macros" I think it would be cleaner. But there may be some reasons to not having done it... For my Scilab understanding, what are the reasons? I don't know. May be none. To me, there is a bunch of questions / issues about this unloader.sce and the ~/etc/module.quit scripts. The default unloader.sce is generated for instance by tbx_make(..) * If the module to unload is an autoloaded ATOMS module, its library is protected. Then trying to clear it yields an expected error. The default unloader.sce does not take this into account. Yet, it should avoid or handle the error without stopping. * unloader.sce should clear loaded functions of the library, as you suggest. Indeed, if it's not wished, it is simple to comment the line in the final version. Otherwise, if you have asked how to do, it's that the syntax is not trivial to find. * atomsQuit() : the documentation (and code) of this function are prone to discussion: 1. its page says that it executes .quit files of all loaded ATOMS modules, while it calls their unloader.sce script 2. its page says "/This function is called by SCI/etc/scilab.quit/". If it is its only usage, then it's an internal, and it should not be documented. 3. According to its code: if the autoloading mode of the ATOMS system is OFF, then atomsQuit() does nothing! That's strange. This could mean that it is definitely not aimed to be used out of the automatic Scilab startup. 4. It can't be used to quit some given modules. Only to quit all loaded modules. So.. 5. Proposals: + Either we keep atomsQuit() as is, and undocument it to make it as an internal function + Or we remove the condition (3), and we add an input argument = vector of modules name to quit. Any comments? Samuel ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users