User's Guide and script snippets
                                
                                
                                
                                    
                                        by Allin Cottrell
                                    
                                
                                
                                        This will be mostly relevant to Jack and Cri.
In the process of cleaning up the formatting of script snippets in 
the TeX manual, I notice that I've been inconsistent in the 
absolute indent given to code snippets (that is, the indent of the 
whole snippet relative to the left margin, as opposed to the 
relative indent of things like loop and mle blocks).
I now propose that all such snippets (i.e., stuff between 
\begin{code} and \end{code}) get an absolute indent of zero in the 
TeX source: put them right up at the left-hand edge.  Now that 
I've learned how to use fancyvrb.sty, a uniform absolute indent 
(if desirable) can be applied at the style file level (in 
gretl.sty).
I wrote a little program (in C, of course ;-) to modify the 
existing English and Italian TeX sources in line with this dictum, 
and I've just committed the results to CVS.
Allin.
                                
                         
                        
                                
                                18 years, 9 months
                        
                        
                 
         
 
        
            
        
        
        
                
                        
                                
                                 
                                        
                                
                         
                        
                                
                                
                                        
                                                
                                        
                                        
                                        disappearing matrices
                                
                                
                                
                                    
                                        by Allin Cottrell
                                    
                                
                                
                                        This is going back a few days:
Sven (Wed, 10 Jan 2007)
> I run the following command:
>
> matrix weakexo = p4g_vecm_weakexo(endo, 2, 1, 3, 0, 0, \
> rexo, 0, uexo)
>
> ...and yes, it's there:
>
> ? weakexo
> weakexo
>
>      3.1524       1.0000     0.075816
>      6.2215       1.0000     0.012621
>
> BUT when I run the script with the function definition
> p4g_vecm_weakexo again (and nothing else!), the previous
> output disappears:
>
> ? weakexo
> command 'weakexo' not recognized
Me (also 10 Jan):
> The action of running a script clears out gretl's workspace. I 
> suspect it might be non-trivial to change that behaviour, though 
> this is something to think about.
I don't know what I was smoking when I wrote that, but the first 
statement is rubbish.  Simply running a script does _not_ clean 
out gretl's workspace, as is easily confirmed by example.
allin@myrtle:~/src/build/cli$ cat testrun.inp
open data4-1
matrix M = I(3)
run r1.inp
print M
allin@myrtle:~/src/build/cli$ cat r1.inp
ols 1 0 2 3 4
run r2.inp
allin@myrtle:~/src/build/cli$ cat r2.inp
omit 3 4
allin@myrtle:~/src/build/cli$ ./gretlcli -b testrun.inp
[ output as expected, culminating in printing of matrix M
   after running the scripts r1.inp and r2.inp. ]
The same thing works in the gui program.
On the other hand, opening a new data file _does_ clear out 
gretl's workspace.  So: Sven, if this is still of interest, could 
you put your question again, with a little more detail?
Allin.
                                
                         
                        
                                
                                18 years, 9 months
                        
                        
                 
         
 
        
            
        
        
        
                
                        
                        
                                
                                
                                        
                                                
                                        
                                        
                                        (more serious) matrix bug
                                
                                
                                
                                    
                                        by Sven Schreiber
                                    
                                
                                
                                        I now have several 'py4gretl' functions calculating some extra VECM
stuff. A problem I encountered during debugging is that generated
matrices "disappear" after redefining the function (without calling them!).
Example:
I run the following command:
matrix weakexo  = p4g_vecm_weakexo(endo, 2, 1, 3, 0, 0, rexo, 0, uexo)
...and yes, it's there:
? weakexo
weakexo
      3.1524       1.0000     0.075816
      6.2215       1.0000     0.012621
BUT when I run the script with the function definition p4g_vecm_weakexo
again (and nothing else!), the previous output disappears:
? weakexo
command 'weakexo' not recognized
Bug or feature? (I vote for bug.)
-sven
                                
                         
                        
                                
                                18 years, 9 months
                        
                        
                 
         
 
        
            
        
        
        
                
                        
                        
                                
                                
                                        
                                                
                                        
                                        
                                        funcerr messages not displayed
                                
                                
                                
                                    
                                        by Sven Schreiber
                                    
                                
                                
                                        One last thing for today...
It seems to me that if a function stops due to a funcerr command, the
associated message (string) is not displayed if the function is
packaged. Instead I get an alert window with "unspecified error".
(everything works fine in scripts and console)
BTW, I'm more and more impressed about the capabilities of gretl's
scripting language!
Good night,
sven
                                
                         
                        
                                
                                18 years, 9 months
                        
                        
                 
         
 
        
            
        
        
        
                
                        
                                
                                 
                                        
                                
                         
                        
                                
                                
                                        
                                                
                                        
                                        
                                        (mostly cosmetic) bugs
                                
                                
                                
                                    
                                        by Sven Schreiber
                                    
                                
                                
                                        Not very important, but before they're forgotten:
- 'list' command not in the online command reference (F1)
- maybe matrix facilities should be mentioned in 'genr' there?
- (reminder to self:) discuss the difference of means test formulae
somewhere
- allow to specify empty (null) lists in function package GUI
- for a matrix 'a' after 'print a' gretl says 'No data' (but then also
prints the matrix alright)
- Then on p. 60 of the A4 user guide there's the following example:
? list xlist = x1 x2 x3
 # list xlist = x1 x2 x3
Added list ’xlist’
? list xlist print
 # list xlist = x1 x2 x3
This doesn't work for me; I have a list named 'endo', but gretl remains
absolutely silent when I do 'list endo print' (tried console and script)
Since the first two (or three) of these things do not fall in the C
programming realm, I could help with them if you like. (Once I've gotten
around to setting up my sourceforge access again.) I would need some
hints on where the relevant files are located, however.
cheers,
sven
                                
                         
                        
                                
                                18 years, 9 months
                        
                        
                 
         
 
        
            
        
        
        
                
                        
                        
                                
                                
                                        
                                                
                                        
                                        
                                        public function interface: 15 char limit?
                                
                                
                                
                                    
                                        by Sven Schreiber
                                    
                                
                                
                                        Ok I'm sorry for this email flood, but they're all separate issues I'm
submitting while I encounter them.
I wanted to package some of the functions (File->Function files-> new
package...), but got the error: "You must specify a public interface"
though I had done so.
All my public functions have more than 15 chars however, and I noticed
the truncation in the public interface text field. So is that the cause?
Is it intended? For the helper functions this doesn't seem to be a
problem, and running from scripts also works fine.
-sven
                                
                         
                        
                                
                                18 years, 9 months
                        
                        
                 
         
 
        
            
        
        
        
                
                        
                        
                                
                                
                                        
                                                
                                        
                                        
                                        edits in function package editor not persistent
                                
                                
                                
                                    
                                        by Sven Schreiber
                                    
                                
                                
                                        [Don't worry, have to stop in half an hour... ;-)]
For a packaged function, trying to edit a helper function ("edit
function code") seems to go well, but re-opening shows that all changes
are reverted.
-sven
                                
                         
                        
                                
                                18 years, 9 months
                        
                        
                 
         
 
        
            
        
        
        
                
                        
                                
                                 
                                        
                                
                         
                        
                                
                                
                                        
                                                
                                        
                                        
                                        Re: [Gretl-users] error with null list
                                
                                
                                
                                    
                                        by Riccardo (Jack) Lucchetti
                                    
                                
                                
                                        
On Thu, January 4, 2007 13:16, Sven Schreiber wrote:
>> First, let's define the concept of a "binary bundle". A binary bundle is a
>> binary file which contains one or more objects. An object can be
>>
>> 1) a scalar
>> 2) a matrix
>> 3) a dataset
>> 4) a model
>>
>
> I would also add: 5) some text, comment, etc.
Not difficult, ok.
> Why does it have to be binary? Human-readable is an advantag IMO. Unless
> you have tons of data, but I doubt you would be using gretl then (no
> offense...).
Point taken. If I knew more than I do about this, the best thing would
actually be xml. Trouble is, I know how to write functions for reading/writing
binary stuff, with xml I'm lost. But I could learn.
About data size: no offense taken, sure, but I'd like you to try what happens
with big datasets. In my experience, gretl is actually very efficient. I've
handled datasets with hundreds of thousands of observations much better than
in other packages.
>> I think this would provide a very neat way to do what I assume you need.
>> However, the coding effort is definitely not trivial. Could we schedule this
>> for 1.7.0?
>
> What if you start out just with the ability to read in "bundles" with
> genr/matrix/print commands (for scalars/matrices/text). Essentially just
> opening the file and executing the literal contents as if the user typed
> them in directly. like a limited version of 'run'. That wouldn't be so
> difficult, would it?
Mmmhhh... I don't like this very much. Setting up a specialised version of
"run" that we know in advance is bound to be scrapped soon looks like a waste
of resources to me...
> (Should we take this off the user list? but keep me cc-ed please, or
> maybe I should subscribe to gretl-devel...)
Indeed. I've cc-ed this message to gretl-devel.
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Facoltà di Economia "G. Fuà"
Ancona
                                
                         
                        
                                
                                18 years, 9 months