Re: [Gretl-devel] really distinguish commands from mere expressions
by Allin Cottrell
On Wed, 10 Nov 2010, Sven Schreiber wrote:
> 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!
Adding To Jack's list of programs that have this behavior: R.
> 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 wouldn't want to give up
<unadorned name of user-define object> -> print object
But for people who feel queasy about this -- fair enough, there
probably should be a way to print the membership of a list via the
"print" command, as you suggest.
Allin
13 years, 10 months
Re: [Gretl-devel] int and bool return types
by Allin Cottrell
On Thu, 11 Nov 2010, Sven Schreiber wrote:
> Hi, some function programming issues/remarks:
>
> 1. Shouldn't the following work according to the example
> "function series get_uhat_and_ess(series y, list xvars, scalar
> *ess[null])" in the manual:
>
> <script>
> function void check(int myarg1, int myarg2[null])
> print "yes"
> end function
> check(1)
> </script>
>
> But I get:
>
> gretl-Version 1.9.2cvs
> Aktuelle Sitzung: 2010-11-11 20:22
> ? function void check(int myarg1, int myarg2[null])
> Syntax-Fehler in Befehlszeile
>
> Fehler bei Skriptausführung: Stopp
> > function void check(int myarg1, int myarg2[null]) ...
If myarg2 is supposed to be a plain integer, it's not the sort of
thing that can be "null" -- only pointer argument can default to
null. Using "int myarg2[0]" would work (myarg2 default to zero).
> 2. functions apparently cannot return bool or int (documented by
> running the trivial ones below). Note that I'm fine with this if
> it's desired behavior, but maybe it isn't...
It's not unintended, at any rate. Our assumption so far has been
that this (i.e. distinguishing between "bool", "int" and "scalar")
is only necessary or useful for function arguments. (Internally,
all such values are floating-point numbers.)
Allin
13 years, 11 months
int and bool return types
by Sven Schreiber
Hi, some function programming issues/remarks:
1. Shouldn't the following work according to the example
"function series get_uhat_and_ess(series y, list xvars, scalar
*ess[null])" in the manual:
<script>
function void check(int myarg1, int myarg2[null])
print "yes"
end function
check(1)
</script>
But I get:
gretl-Version 1.9.2cvs
Aktuelle Sitzung: 2010-11-11 20:22
? function void check(int myarg1, int myarg2[null])
Syntax-Fehler in Befehlszeile
Fehler bei Skriptausführung: Stopp
> function void check(int myarg1, int myarg2[null])
2. functions apparently cannot return bool or int (documented by running
the trivial ones below). Note that I'm fine with this if it's desired
behavior, but maybe it isn't...
<script>
function scalar hey3(void)
print "yes3"
end function
hey3()
function int hey2(void)
print "yes2"
end function
hey2()
function bool hey(void)
print "yes"
end function
hey()
</script>
thanks,
sven
13 years, 11 months
Re: [Gretl-devel] Model table
by Allin Cottrell
On Wed, 10 Nov 2010, Henrique Andrade wrote:
> I would like to suggest two little changes in the "Model table" (inside
> Gretl's icon view):
>
> (1) Sometimes we need to include different models with different
> dependent variables into a Gretl session, so, in these circumstances
> it would be good if we could create more than one "Model table" to
> better compare our results.
Maybe it'll happen ;-)
> (2) The next suggestion is related to the model table itself: What
> do you think about include the name of the equations instead of
> the numbers (1), (2), (3), and so on?
In the model table window, click the "Reformat" button: that gives
you the option of using the model names.
Allin Cottrell
13 years, 11 months
Re: [Gretl-devel] string comparison
by Allin Cottrell
On Wed, 10 Nov 2010, Sven Schreiber wrote:
> the following script gives an error at the != comparison for the string
> variable:
>
> <script>
> string check = "h"
> if check="h"
> print "equality check works"
> endif
> if check!="h"
> print "but inequality doesn't"
> endif
> </script>
>
> I'm not sure if any of this is supposed to work, but at least the
> equality part is very useful for me.
The equality part is documented as working; the inequality part
was just not implemented. That was an oversight, now fixed in CVS.
Allin
13 years, 11 months
string comparison
by Sven Schreiber
Hi,
the following script gives an error at the != comparison for the string
variable:
<script>
string check = "h"
if check="h"
print "equality check works"
endif
if check!="h"
print "but inequality doesn't"
endif
</script>
I'm not sure if any of this is supposed to work, but at least the
equality part is very useful for me.
thanks,
sven
13 years, 11 months
Model table
by Henrique Andrade
Dear Developers,
I would like to suggest two little changes in the "Model table" (inside
Gretl's icon view):
(1) Sometimes we need to include different models with different
dependent variables into a Gretl session, so, in these circumstances
it would be good if we could create more than one "Model table" to
better compare our results.
(2) The next suggestion is related to the model table itself: What
do you think about include the name of the equations instead of
the numbers (1), (2), (3), and so on?
Best regards,
Henrique C. de Andrade
Doutorando em Economia Aplicada
Universidade Federal do Rio Grande do Sul
www.ufrgs.br/ppge
13 years, 11 months
really distinguish commands from mere expressions
by Sven Schreiber
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... ;-)
thanks,
sven
13 years, 11 months
Re: [Gretl-devel] units or groups
by Allin Cottrell
On Tue, 9 Nov 2010, Sven Schreiber wrote:
> while updating the (German) translation I noticed that gretl uses two
> different terms for the panel cross-section dimension: "unit" and "group".
I think we also use "individual" in some places; that's quite
common in the panel literature. And using both "group" and
"individual" to refer to the same thing may be confusing to some.
> This is perfectly understandable because that's what also happens in the
> real world, but to minimize confusion I'm wondering whether we should
> make a definite choice on which term gretl uses.
>
> Personally I would opt for "group", since for "unit" there is this clash
> with unit root tests (as in 'each unit has a unit root').
I'd be willing to standardize usage. Any other thoughts on this?
Allin
13 years, 11 months