[ruby-core:85360] Re: [PATCH] compile.c: avoid String#+@ call with FSL

From: Eric Wong <normalperson@...>
Date: 2018-02-03 09:05:36 UTC
List: ruby-core #85360
"Martin J. D端rst" <duerst@it.aoyama.ac.jp> wrote:
> On 2018/02/03 16:39, Eric Wong wrote:
 
> > When using "frozen_string_literal: true", String#+@ is often
> 
> > used to create mutable strings.  Treat it like an immutable
> 
> > syntax to allow for optimization.
> 
> 
> Sorry, I don't get this. If somebody wants a mutable String, they should get
> a mutable string. Or can we treat it as immutable and later still provide a
> mutable string (something like copy on write)?

Sorry, confusing wording.  What I meant was Ruby syntax is
immutable and cannot be redefined at runtime.

So I want String#+@ to behave like Ruby syntax (not like typical
redefinable method).

Actual behavior is unchanged unless somebody redefines String#+@

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread