On Sun, 3 Sep 2006 at 7:09pm, A.J.Mechelynck wrote:

> 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.

I think your opinions are subjective. I personally never got confused by
the use of these operators and find them to have very clean expression.
>
>       let val += 1
>       return (val - 1)
>
> is much clearer for someone who doesn't use C day-in day-out. At least

I find this more confusing than using a post-increment operator. You are
expressing a logic that is distributed in multiple lines, and to me that
definitely is less expressive than simply returning val++. Again, this
is very subjective, and so I am not surprised that you find it
differently.

> 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".

I agree that this constuct is heavily subject to errors and
most post-C/C++ languages boast generating a compiler error to prevent
unexpected bugs, but I didn't get what your point here is w.r.t. to the
subject of this thread.

>
> Best regards,
> Tony.

-- 
Thanks,
Hari

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Reply via email to