Hari Krishna Dara wrote:
On Sun, 3 Sep 2006 at 2:23pm, Bram Moolenaar wrote:
Yakov Lerner wrote:
On 9/3/06, Bram Moolenaar <[EMAIL PROTECTED]> wrote:
I still miss pre and post increment and decrement operators (avoids a
separate :let command by itself),
You mean, as in:
:let linenr = a++
I don't know how difficult this is to implement, and if there are any
conflicts in the syntax.
And then probably
:let linenr ++
, too ?
That looks weird. You can do it already with:
:let linenr += 1
Right, I am not talking about this case, but inside expressions, like
in:
return val++;
instead of saying:
let oldval = val
let val += 1
return oldval
or in:
let ar[i] = ar[i++]
Expressions with side-effects (or value-returning assignments, depending
on point of view) are a head-breaker in C. I hate them. Too often I
won't see the error when some dumbass (me included) writes a++ where ++a
should have been, or vice-versa.
let val += 1
return (val - 1)
is much clearer for someone who doesn't use C day-in day-out. At least
Vim doesn't allow "if (x = y)" which is perfectly legal in C, where it
means "set x equal to y, and return TRUE if the value is nonzero" and
not as a novice would expect, "return TRUE if x equals y".
Best regards,
Tony.