On Sat, 22 Jan 2011, Sven Schreiber wrote:
[moving over to gretl-devel, where I probably should have started
this
anyway]
Am 21.01.2011 17:39, schrieb Riccardo (Jack) Lucchetti:
> On Fri, 21 Jan 2011, Sven Schreiber wrote:
>
> A few remarks:
>
> * We don't have "clear", which would probably be nice, but we have
> "nulldata": "nulldata 2" probably does what you want.
Yeah, except that it also clears the dataset, which is maybe not what I
want. Maybe 'nulldata' could be merged into a new 'clear' somehow?
clear --data # like nulldata --preserve
clear --all # like nulldata
clear # only clear variables like matrices, scalars, bundles,
strings, lists(?)...
???
(This is clearly a suggestion I only dare making in the context of the
pre-2.0 cycle, in general I would find it too disruptive.)
For the sake of completeness, I wouldn't be against a "clear" command to
get rid of selected categories of items. Maybe we could spice up the
"delete" command a bit, like for example adding a --matrix option to
delete matrices only, etc.
> * The relative merits of strong typing vs weak typing will always
be an
> object for discussion. I personally prefer strong typing, but I concede
> that in a world where the most popular matrix-oriented languages are
> weakly-typed perhaps you have a point.
My point was not against strong typing in this context (although it
helped to trigger the error here, of course). It would be fine if in the
scope of the script the type of temp were fixed (strong typing). I'm
pointing out the problems of the fact that the scope of the variable
temp is automatically global, i.e. extends beyond the current script.
No, sorry, I don't like this at all. The "include" command must leave
objects alone. On a somewhat related subject: do we still want to keep
both "include" and "run" for 2.0?
> * I would guess that if you have scripts that are meant to be run
one
> after another with little or no editing, perhaps you ought to use
> functions and keep the usage of global variables at a minimum. Perhaps
> bundles may help too.
AFAICS this essentially would imply that *everything* needs to be
wrapped inside functions. I don't think that would be good. Note I
didn't *want* to make thiese variables global, but with gretl's current
behavior I don't have a choice (if I don't want to wrap everything in a
function); so I view your statement "keep global variables at a minimum"
as supporting my point!
Not really. If you want to use something as a black box, yes. But
otherwise, I don't see why. For example: I have a fairly large project
open, a paper my co-authors and I have been working on for quite a long
time. I have a script, called prepare_data, that sets everything up for
estimation, testing etcetera. The dataset gets opened there, basic
transformation are done there, global scalars/matrices/lists are defined
there. Its purpose is precisely to define stuff that is meant to remain
global for the whole session, so that I can have as many scripts as I need
that start with "include prepare_data.inp" and proceed from there.
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti