[#70257] [Ruby trunk - Feature #11420] [Open] Introduce ID key table into MRI — ko1@...

Issue #11420 has been reported by Koichi Sasada.

11 messages 2015/08/06

[ruby-core:70530] Re: [Ruby trunk - Feature #11473] Immutable String literal in Ruby 3

From: Eric Wong <normalperson@...>
Date: 2015-08-21 19:34:21 UTC
List: ruby-core #70530
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)"

In This Thread

Prev Next