[Gretl-devel] Belated response to Sven on function packages

Allin Cottrell cottrell at wfu.edu
Sat Apr 28 14:44:50 EDT 2007


On Sat, 28 Apr 2007, Sven Schreiber wrote:

(Sorry, I can't answer all of these points right now, but I'll try 
some.)

> The versions 0.9.2 of two of the three files are on the server now, no
> more version numbers in the filenames. They should fail less often now.

Thanks, I'll archive the old ones and get them out of the way.

> The one that is missing is py4gretl_vecdecomp, because I found out that
> gretl seems to have a 4KB line length limit (regarding script files
> invoked with the "run" command) -- which is understandable, but
> sometimes breaks the (admittedly) clumsy way how py4gretl_vecdecomp
> passes the calculated time series from Numpy back to gretl in a
> temporary text file. Would that limitation be easy to lift, or should I
> think of a way to work around that?

Don't know offhand; I'll take a look.

> There are still issues when creating new packages... sometimes 
> gretl uses a helper function of a previously executed package 
> instead of a newer version helper function that was run 
> afterwards.

That's expected.  Helper functions don't have to have unique 
names.  If you load package A that has helper function foo, then 
package B that also has a helper function foo, both helpers are 
held in memory, indexed by their respective packages.  Otherwise 
loading B could break A.  If A's public function calls "foo", it 
gets A's version; if B's public function calls "foo" it gets B's 
version.  If "foo" is called from outside any package, you get the 
first available definition.

> I think if you really want to make the helper functions of 
> existing packages available easily (i.e., w/o copy & paste), the 
> namespaces (or what you want to call it) should be separated: So 
> if f1() is a helper function in a loaded package called 
> "superpackage", and a (possibly different) function f1() has 
> been run by the user, the function chooser for packaging should 
> label them for example as "f1 (superpackage)" and "f1". 

Yes, that sounds like a good idea.

> Some other misc. stuff I came across (all on Windows, pretty recent
> snapshot):
> 
> * why is "#" in a matrix definition line invalid?

Where would you expect it to be valid?  I would expect it to work 
as a comment, and here it does:

? matrix M = I(3)  # identity matrix
 matrix M = I(3)
Generated matrix M
? M
 M
M (3 x 3)

      1.0000       0.0000       0.0000 
      0.0000       1.0000       0.0000 
      0.0000       0.0000       1.0000 

> * closing function package call window by window close cross
>  doesn't work

Will check that.

> * IIRC some snapshots ago saving files with a script
> into "./" would save them into "c:\Dokumente und Einstellungen\<loginname>"
> and now it seems to be "c:\Dokumente und
> Einstellungen\<loginname>\Eigene Dateien".
> Has that changed or am I mixing things up?

I don't think that has changed.

> * out of curiosity: has the behavior of printf in combination 
> with a matrix changed? Earlier I believe it would print out all 
> elements, now only the first one.

I'm surprised it works at all -- that it prints out the first 
element is some sort of strange freebie.  So far as I'm aware it 
never printed the whole matrix.

Allin.


More information about the Gretl-devel mailing list