Am 26.12.2020 um 16:18 schrieb Artur Tarassow:
Am 26.12.20 um 14:57 schrieb Sven Schreiber:
> Am 15.11.2020 um 23:19 schrieb Allin Cottrell:
>> Hmm, seems to me that "clear" with no option
probably ought to do that
>> (unload all functions), the general idea being that it returns gretl to
>> pristine state. Would it be too backward incompatible to arrange for
> [sorry for the delay] - No, I don't think so. Typically you want to keep
> functions around if you do 'open' or 'nulldata', and that should
> But for 'clear' it's not documented that functions stay active, and
> actually it could be declared a minor bug. So the only remaining
> question then is whether there should be an option to _keep_ functions?
I have to admit that I never seen anybody unloading some function at
some point in a program.. I just searched whether something similar is
possible for Python but could not find anything. Even unloading a module
does not seem to be supported in Python.
Well, simply try this in Python:
In : def check(): return "hey"
In : check()
In : del check
In : check() # will fail
Do you have a use-case for such a feature? I could not imagine any
My use case has to do with testing of functions and packages, so a bit
special I admit. Nonetheless given the absence of namespaces in
gretl/hansl it could happen that you get a second function with the same
name which you the cannot load because the name is blocked by the first one.