Closed GoogleCodeExporter closed 8 years ago
I was under the impression you can't reassign variable inside a closure in
groovy++?
Original comment by wmacgy...@gmail.com
on 2 Apr 2011 at 6:12
Well, we definitely need better message but in general in Groovy++ (before we
finished good inlining possibilities) it is not possible to change bound
variable inside closure.
Original comment by alex.tka...@gmail.com
on 2 Apr 2011 at 7:13
OK, you can say that Groovy++ encourages a purely functional programming style
;)
Original comment by adam%sch...@gtempaccount.com
on 3 Apr 2011 at 10:53
I wish we could say so but it would not be true. The main reason is that we can
not (yet!) separate case when closure is effectively inline from the case when
it can be passed to another thread. There are also performance considerations
to make shared variable immutable.
Original comment by alex.tka...@gmail.com
on 3 Apr 2011 at 12:00
The snippet provided now seems to be failing with the clearer error message
"Cannot modify final field TryGroovy$foo$1.s".
Original comment by roshanda...@gmail.com
on 5 May 2011 at 5:14
Original comment by alex.tka...@gmail.com
on 24 May 2011 at 11:20
Original issue reported on code.google.com by
adam%sch...@gtempaccount.com
on 2 Apr 2011 at 5:12