[#79532] Immutable Strings vs Symbols — Daniel Ferreira <subtileos@...>

Hi,

15 messages 2017/02/15

[ruby-core:79676] Re: [Ruby trunk Feature#13077] [PATCH] introduce String#fstring method

From: Eric Wong <normalperson@...>
Date: 2017-02-22 09:37:11 UTC
List: ruby-core #79676
matz@ruby-lang.org wrote:
> For the time being, let us make `-@` to call `rb_fstring`.
> If users want more descriptive name, let's discuss later.
> In my opinion, `fstring` is not acceptable.

OK, I think the following is always backwards compatible,
unlike my previous [ruby-core:78884]:

--- a/string.c
+++ b/string.c
@@ -2530,7 +2530,7 @@ str_uminus(VALUE str)
 	return str;
     }
     else {
-	return rb_str_freeze(rb_str_dup(str));
+	return rb_fstring(str);
     }
 }
 

Will commit in a day or two.

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

In This Thread

Prev Next