ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:96777] [Ruby master Feature#16501] Support marshaling of ruby2_keywords flag
       [not found] <redmine.issue-16501.20200111063117@ruby-lang.org>
@ 2020-01-11  6:31 ` mame
  2020-01-11 11:07 ` [ruby-core:96778] " eregontp
  2020-01-16  5:30 ` [ruby-core:96884] " matz
  2 siblings, 0 replies; 3+ messages in thread
From: mame @ 2020-01-11  6:31 UTC (permalink / raw)
  To: ruby-core

Issue #16501 has been reported by mame (Yusuke Endoh).

----------------------------------------
Feature #16501: Support marshaling of ruby2_keywords flag
https://bugs.ruby-lang.org/issues/16501

* Author: mame (Yusuke Endoh)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:96778] [Ruby master Feature#16501] Support marshaling of ruby2_keywords flag
       [not found] <redmine.issue-16501.20200111063117@ruby-lang.org>
  2020-01-11  6:31 ` [ruby-core:96777] [Ruby master Feature#16501] Support marshaling of ruby2_keywords flag mame
@ 2020-01-11 11:07 ` eregontp
  2020-01-16  5:30 ` [ruby-core:96884] " matz
  2 siblings, 0 replies; 3+ messages in thread
From: eregontp @ 2020-01-11 11:07 UTC (permalink / raw)
  To: ruby-core

Issue #16501 has been updated by Eregon (Benoit Daloze).


Makes sense to me that Marshal knows how to preserve that flag.
(Sidekiq used Marshal in previous versions, but switched to a manual copy for efficiency)

----------------------------------------
Feature #16501: Support marshaling of ruby2_keywords flag
https://bugs.ruby-lang.org/issues/16501#change-83771

* Author: mame (Yusuke Endoh)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ruby-core:96884] [Ruby master Feature#16501] Support marshaling of ruby2_keywords flag
       [not found] <redmine.issue-16501.20200111063117@ruby-lang.org>
  2020-01-11  6:31 ` [ruby-core:96777] [Ruby master Feature#16501] Support marshaling of ruby2_keywords flag mame
  2020-01-11 11:07 ` [ruby-core:96778] " eregontp
@ 2020-01-16  5:30 ` matz
  2 siblings, 0 replies; 3+ messages in thread
From: matz @ 2020-01-16  5:30 UTC (permalink / raw)
  To: ruby-core

Issue #16501 has been updated by matz (Yukihiro Matsumoto).


I agree. Accepted.

Matz.


----------------------------------------
Feature #16501: Support marshaling of ruby2_keywords flag
https://bugs.ruby-lang.org/issues/16501#change-83896

* Author: mame (Yusuke Endoh)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-16  5:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <redmine.issue-16501.20200111063117@ruby-lang.org>
2020-01-11  6:31 ` [ruby-core:96777] [Ruby master Feature#16501] Support marshaling of ruby2_keywords flag mame
2020-01-11 11:07 ` [ruby-core:96778] " eregontp
2020-01-16  5:30 ` [ruby-core:96884] " matz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).