On Fri, 4 Nov 2016, Artur T. wrote:
Hi all,
I am trying to remove a helper function (named e.g. H1) from an existing
package and replace it by another one (named H2) using the GUI. However,
after pressing 'ok' and saving the changed 'version', the old helper
function H1 is still listed and not replaced by the new one H2.
This sounds like the same issue that was raised by Sven a month or
two ago. At that time I tried to replicate the problem, but
couldn't. Unfortunately there are several variables that could, in
principle, affect the outcome (Is the package saved to its
"installed" location? Does the user have write permission on that
location? Are there two versions of the package on the system?)
Anyway, I have again tried and failed to replicate the issue. Here's
exactly what I did:
1) Started gretl and ran this script containing totally bogus
functions:
<hansl>
function scalar priv1 (scalar x)
return 1 * x
end function
function scalar priv2 (scalar x)
return 2 * x
end function
function matrix public (series y)
matrix m = {y}
k = priv1(3)
return m * k
end function
</hansl>
2) Went to /Tools/Function packages/New package and started a
package under the name "testing". Selected functions "public" and
"priv1" for inclusion. Added trivial description, help, etc. and
saved the gfn to a "non-installed" location under my home directory.
3) Closed the package editor. Quit gretl.
4) Restarted gretl, opened the original function definition script,
selected and ran the code for priv2 to put it into memory.
5) Went to /Tools/Function packages/Edit package and selected
testing.gfn for editing. Went to "Add/remove functions", removed
priv1 and added priv2; also edited public to call priv2 instead of
priv1. Chose Save/Save gfn. At this point the "Edit function code"
lister correctly shows public and priv2.
6) Quit gretl. Restarted gretl. Again opened testing.gfn for editing
under /Tools. The functions shown are public and priv2, as expected.
7) For good measure I then reversed the previous procedure, removing
priv2 and re-selecting priv1; save gfn; quit; restart; check: now
public and priv1 are shown as included.
Allin