Yes, but a toString method with side effects is a really bad coding practice that won't be fixed simply by reducing the power of GString. Far from it. Actually it will manifest in even worse ways. GString merely makes it visible. Rather, a compiler warning or IDE warning about side effects in methods inherited from Object and overriden is a nice, non invasive way of dealing with the same problem.
On Mon, 10 Sep 2018 at 14:27, Daniel.Sun <[email protected]> wrote: > What I want to refine is the confusing GString feature shown by the first > example(toString method with side effects) > > P.S. I never propose to make most of users' code not work and angry. > > Cheers, > Daniel.Sun > > > > > ----- > Daniel Sun > Apache Groovy committer > Blog: http://blog.sunlan.me > Twitter: @daniel_sun > > -- > Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html >
