Am 30.09.2010 15:01, schrieb Allin Cottrell:
On Thu, 30 Sep 2010, Sven Schreiber wrote:
> this is a feature request for gretl 2.0:
> Even simple expressions aren't possible in loop conditions, for example:
> "loop for i=1..p-1"
> doesn't work, which inflates the trivial LOCs needed in gretl scripts.
Yes, that could be supported. In the meantime, you can use a
proper "for" loop if you want parsing of the conditions:
loop for (i=1; i<=p-1; i++)
See chapter 9 of the User's Guide. Also note that the syntax you
give above, "loop for i=1..p-1" is actually a (tolerated) error:
there shouldn't be any "for" in what the Guide calls an index
whoops, good to know...
Ok, in principle gretl does everything one (I) needs. But maybe this
pre-2.0 period is the right time to discuss this a little:
* "i=1..p-1" has eight chars (but isn't working of course)
* "(i=1; i<=p-1; i++)" has 16 chars
That's double the other amount, not even counting blanks and if you
leave out the "for" in the first version (which I never did so far) the
difference gets bigger. Readability is also better in the first version
IMHO, but that may be because I'm more used to it. However, "i++" is
very C-ish und not very gretl-ish I dare to say (I know I can also write
So I'm inclined not to withdraw that feature request.