gnu-octave / symbolic

A Symbolic Package for Octave using SymPy
https://octave.sourceforge.io/symbolic/
GNU General Public License v3.0
152 stars 36 forks source link

Investigate PKG_DEL scripts #1176

Open cbm755 opened 2 years ago

cbm755 commented 2 years ago

its pkg unload's fault for not giving us a hook

Not sure what exactly you need. But the PKG_DEL scripts might do something similar. See: https://docs.octave.org/latest/Creating-Packages.html Essentially, these scripts are executed whenever the path containing them is removed from Octave's load path. That is happening on pkg unload. (But admittedly, it's not a real hook but just a script.) Maybe you could use (mlocked) functions that keep some values stored in persistent variables if you need to access them from the PKG_DEL script?

Originally posted by @mmuetzel in https://github.com/cbm755/octsympy/issues/1175#issuecomment-1175083790

alexvong243f commented 2 years ago

In the future, we should investigate whether to trigger cleanup in PKG_DEL script. This could simplify our current approach.