Allin Cottrell schrieb:
On Wed, 3 Mar 2010, Sven Schreiber wrote:
> Sure; that's why I think help may be needed to ease the
transition by
> automating it as far as possible. BTW, I don't understand yet why it's
> necessary to replace "end if", but I guess that's for another thread.
OK, I'll hijack the current thread for that purpose!
First, this is not a big deal. We incur a very small (but
unsightly!) overhead in intercepting "end if" and "end loop" and
converting them to the "correct" one-word versions.
Why are the one-word versions correct? Here's my rationale:
various blocks of instructions in gretl have a start and an end on
distinct input lines (if, loop, mle, nls, gmm, restrict,
system,...), but among these "if" and "loop" are special, in that
they are all-purpose, nestable syntactical constructs.
So I'm thinking that these particular constructs warrant a
specific ending tag -- like "if" and "fi", "case" and
"esac", "do"
and "done" in bash. And indeed, the specific ending tags "endif"
and "endloop" have been in the manual for ages; they are the
primordial forms.
But I'm aware that this is mostly an aesthetic issue -- conversion
from the deprecated forms presumably takes a few nanoseconds at
worst -- so this is not a point that I'd push very hard.
Personally I have not been able to remember which of the "end" tags need
a blank and which do not. To my brain "end if" is like "end function"
and I guess I would produce a lot of coding errors in the future if "end
if" were not allowed anymore. I suspect that this problem would bite
many other users as well. (But of course I may be wrong.)
Note that my argument is purely "psychic", but may be important
nevertheless.
So I would favor one of the two solutions:
* essentially keep the current situation
* get away with all the blanks, for example "endgmm"
* or change "end if" and "end loop" to something quite different
which
IMHO would be easier to remember than the special blank -- but what
exactly, I don't have a good idea?
Ironically, after discussing this now at some length I will probably
always remember what's the difference between the various "end"s... but
other users won't!
thanks,
sven