On Wed, 10 Nov 2010, Sven Schreiber wrote:
Hello all,
here's a relatively radical suggestion for gretl 2.0, namely to properly
distinguish statements (=commands) from mere expressions. What do I mean:
Right now, the following
<script>
matrix whatever = zeros(2,2)
whatever
</script>
prints the matrix called 'whatever'.
What bugs me is the line with just the matrix name, why should that
print anything at all, it's not a print command!
It seems that right now for most objects it doesn't make much of a
difference whether you write 'print myobject' or just 'myobject', with
the important (unique?) exception of list objects. (Reminder for
non-Allin readers: 'print mylist' prints the contained values of the
member series, whereas 'mylist' prints the *names* of the member series.)
So to get the member names for list objects I would suggest to replace
the syntax 'mylist' with:
'print mylist --membernames'
or somesuch.
I'm sure no everybody will like it at first sight, but once you start
thinking about it, isn't it compelling... ;-)
Using an empty string as an alias for the "print" command is quite
common in matrix languages like Matlab/Octave, gauss etc; I personally
find it very useful when working in interactive mode. Actually, I'd like
it even better if it was an alias for "eval", so you could print out
complex expressions "on the fly".
From a strictly aesthetic point of view, I'm more worried about
another
idiosyncratic aspect of lists: you can't delete them! This wouldn't
be a
problem in terms of occupied memory, which is tiny. The problem is that
once you have defined "foo" as a list, that identifier cannot be used
for anything but a list. The problem is relatively moot if you use
functions (the namespace is local), but may be serious if you have a
script of several hundred lines.
Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche
r.lucchetti(a)univpm.it
http://www.econ.univpm.it/lucchetti