ruby-core

Mailing list archive

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

From: Martin J. Dürst <duerst@...>
Date: 2018-02-03 08:47:33 UTC
List: ruby-core #85361
On 2018/02/03 16:39, Eric Wong wrote:
 >> Eric Wong wrote:

 >> Considering String#+@ and String#-@ look like syntax elements

 >> and are relatively new; can get rid of redefinition check in

 >> opt_str_uminus?

 >

 > Maybe we can do this (still running tests, will take a while):

 >

 > ----8<---

 > Subject: [PATCH] compile.c: avoid String#+@ call with FSL

 >

 > 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)?

Regards,    Martin.

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

In This Thread