groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mauro Zallocco <mzallo...@gmail.com>
Subject Re: Parrot and the ++ and -- operators
Date Sun, 12 Feb 2017 15:11:24 GMT
Hi all.

I tried this:
groovy -version
Groovy Version: 2.4.6 JVM: 1.8.0_66 Vendor: Oracle Corporation OS: Windows 7

int i = 0
++(++(++i));
assert i == 1

However with C++, it gives 3.

#include <assert.h>

int main() {
  int i = 0;
  ++(++(++i));
  assert(i==3);

  return 0;
}

I think 3 is correct.
True?



On Tue, Jan 24, 2017 at 12:46 PM, Joe Wolf <joewolf@gmail.com> wrote:

> Good to know I'll be able to use these patterns in Groovy 3...I think :)
>
> -Joe
>
> On Tue, Jan 24, 2017 at 11:00 AM, Daniel Sun <realbluesun@hotmail.com>
> wrote:
>
>> Hi Joe,
>>
>>       I've added your sample code as test
>> cases(https://github.com/danielsun1106/groovy-parser/commit/
>> 9914682e53fb2fe3d4bb335c8153e61066cea317).
>> Parrot has same result with the old parser ;)
>>
>> Cheers,
>> Daniel.Sun
>>
>>
>>
>> --
>> View this message in context: http://groovy.329449.n5.nabble
>> .com/Parrot-and-the-and-operators-tp5737960p5737973.html
>> Sent from the Groovy Dev mailing list archive at Nabble.com.
>>
>
>

Mime
View raw message