[chuck-users] ++ return value
gewang at CS.Princeton.EDU
Tue Jun 27 17:42:21 EDT 2006
The ++ and -- (post and pre) are a bit fishy right now. We plan to fix
In the meantime, it safest to NOT used them inline with expressions.
Thanks for the reporting this and sorry for the inconvenience.
> I expected the ++ (and --) operator to work as this:
> If ++ precedes the variable, e.g. ++i, the value returned is the value
> in counter after it has been incremented. If ++ follows the variable,
> e.g. i++, the value returned is the value in counter before it has been
> This doesn't seem to be the case (chuck always returns the value after
> it has been incremented):
> int i;
> [atte at aarhus tests]$ chuck increment.ck
> 0 :(int)
> 1 :(int)
> 2 :(int)
> Maybe this could be changed?
> peace, love & harmony
> http://www.atte.dk | quartet: http://www.anagrammer.dk
> http://www.atte.dk/gps | compositions: http://www.atte.dk/compositions
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
More information about the chuck-users