[nem-en] incorrect side effect of ++ operator

Ricardo Fernández Pascual ric at users.sourceforge.net
Mon Sep 27 16:38:34 CEST 2004


El lun, 27-09-2004 a las 14:48, Michal Moskal escribió:
> On Mon, Sep 27, 2004 at 02:32:53PM +0200, Kamil Skalski wrote:
> > Probably you are right, that this is conterintuitive for C programmer. I also 
> > liked the semantics of tab [i++] = 5;
> > 
> > But in functional language it is better to keep assignments having type void.

I totally agree with this. Assignments are actions, they should not be
used inside expressions, it is confusing.

> So it is to be reconsidered whether to make unused value warnings
> optional. In fact this warning have never prevented me from making
> any mistake.

FWIW, I like the current behaviour and I think it should be the default.
Most times, it may not be an error to ignore a result, but I think it is
bad style.

> Another thing to reconsider is the if/when/unless issue, maybe there
> should be just if. But I'm not sure about this one.

I like the current situation about this too, it makes the language more
simple and avoids ambiguity. However, it doesn't matter very much in
practice, as seen in other languages.


-- 
Ricardo Fernández Pascual
ric at users.sourceforge.net
Murcia. España.






More information about the devel-en mailing list