From: Eric Wong Date: 2015-08-21T19:34:21+00:00 Subject: [ruby-core:70530] Re: [Ruby trunk - Feature #11473] Immutable String literal in Ruby 3 billk@cts.com wrote: > Yusuke Endoh wrote: > > Objection, unless a bailout is provided. > > > > `""` as a StringBuilder is acutally useful. `"".dup` is too tiring. > > Wow. Thanks for mentioning string building. It occurs to me I build > strings like this somewhat regularly: > > sql = %{SELECT #{sec_id}, pt.path, st.doc_count } > sql << %{FROM #{stats_tablename} AS st } > sql << %{JOIN #{path_tablename} AS pt ON (st.path_id = pt.id) } > > So this will break in 3.0 ? Yes, it seems so :< Fwiw, I normally rely on '\' in the parser whenever possible to avoid extra temporary strings + VM instructions: sql = "SELECT #{sec_id}, pt.path, st.doc_count" \ " FROM #{stats_tablename} AS st" \ " JOIN #{path_tablename} AS pt ON (st.path_id = pt.id)"