[Gretl-devel] Re: comment on user-functions and packages
Sven Schreiber
svetosch at gmx.net
Sat Jan 27 18:10:48 EST 2007
Allin Cottrell schrieb:
> There's one related issue I'll mention. We want to ensure that (a) all
> gretl function _packages_ have unique names, and (b) that these names
> correspond to the package's public interface (with ".gfn" appended). To
> help enforce this I've removed the "Save As" button from the function
> package editor -- it seems to me that button was inviting problems. In
> addition, if you make a new package with public interface "somefunc",
> then go to Save, you'll be prompted to save as "somefunc.gfn" (with a
> choice of which directory to save to). If you overwrite the suggested
> .gfn name, so that it no longer matches the public interface, you'll get
> an error message.
>
> Also related: when you're editing a function package you can edit the
> code of the functions it contains, but you can't change the names of
> those functions. In the (I hope) fairly unlikely case that you want ro
> redo a function package, renaming the member functions, you'll have to
> do something like this:
>
> * Load the original package.
> * "Edit" the original package and call up its code
> * Copy and paste the code you want to a script window
> * Rename the functions in the script, and run the script
> * Create a new package that bundles the renamed functions
>
> This is not supposed to be particularly easy, because messing around
> with function names in existing packages would create a big programming
> headache.
>
>
I completely understand the need for static function names. It seems to
me, however, that your requirement "b" (public function name == function
package name) then makes versioning of packages difficult.
In effect I think I don't quite understand the need for this requirement
b. Or maybe requirement b is really two requirements: First: public
function name == function package name. And second: function package
name == package filename plus ".gfn"?
I have various versions of packages that are easily distinguishible in
the package manager by their version number. But the names of the
functions in them are all the same. I manually save the packages with
version numbers in their filenames. What would be useful IMHO is to
automatically append the version number as a suffix (or interfix, to be
precise) to the package .gfn file, to keep the filename matched to the
actual version of the package.
Ok, it's late, maybe I just mixed something up...
-sven
More information about the Gretl-devel
mailing list