From: nagachika00@... Date: 2020-07-23T07:59:18+00:00 Subject: [ruby-core:99292] [Ruby master Bug#16501] Support marshaling of ruby2_keywords flag Issue #16501 has been updated by nagachika (Tomoyuki Chikanaga). Backport changed from 2.5: DONTNEED, 2.6: DONTNEED, 2.7: REQUIRED to 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONE ruby_2_7 ae804b143455075687c8b4a401fba48fda72a217 merged revision(s) b23fd59cbb3f097bcd559d0c85a86ff7a1eeeb7e. ---------------------------------------- Bug #16501: Support marshaling of ruby2_keywords flag https://bugs.ruby-lang.org/issues/16501#change-86681 * Author: mame (Yusuke Endoh) * Status: Closed * Priority: Normal * Backport: 2.5: DONTNEED, 2.6: DONTNEED, 2.7: DONE ---------------------------------------- This patch makes Marshal.dump and load aware of ruby2_keywords flag. https://github.com/ruby/ruby/pull/2830 ``` def bar(key:) key end ruby2_keywords def foo(*args) args = Marshal.load(Marshal.dump(args)) bar(*args) end foo(key: 42) #=> 42 ``` Honestly, I'm not fully convinced if this is really needed. It would be helpful for applications and libraries that serializes the whole arguments by using Marshal, e.g., drb. (Currently, drb does not support keyword separation.) But I'm unsure how many applications does so; ActiveJob and Sidekiq use their own dedicated serialization mechanism based on JSON. This patch does not help them, and they should use #16486 to support ruby2_keywords flag. I'd like to hear opinions. -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>