From: marcandre-ruby-core@... Date: 2020-10-21T04:08:09+00:00 Subject: [ruby-core:100463] [Ruby master Feature#17256] Freeze all Regexp objects Issue #17256 has been updated by marcandre (Marc-Andre Lafortune). Dan0042 (Daniel DeLorme) wrote in #note-6: > Given that string literals with interpolation were recently unfrozen, it would appear slightly inconsistent to freeze regexp literals with interpolation. The difference is that there are many methods and usecases to mutate a String, and none that we know of to mutate a Regexp. ---------------------------------------- Feature #17256: Freeze all Regexp objects https://bugs.ruby-lang.org/issues/17256#change-88082 * Author: ko1 (Koichi Sasada) * Status: Open * Priority: Normal * Assignee: matz (Yukihiro Matsumoto) ---------------------------------------- To be shared between ractors, Regexp objects should be frozen. Now, Matz has proposed to make all Regexp objects frozen. Ten months ago, there was a note https://bugs.ruby-lang.org/issues/16377#note-7 : > For the record: Regexp.new should continue to return unfrozen Regexp instance. So I'm not sure whether it is a good way or not. Could you give me your comment on it? If no comments are given, I'll try to freeze them before Ruby 3.0 preview 2. BTW, I believe `/#{expr}/o` should be frozen because this expression only returns one Regexp object. -- https://bugs.ruby-lang.org/ Unsubscribe: