Project

General

Profile

Actions

Feature #16240

closed

Are all objects and methods marshalable

Added by mattumd (Matt Zand) over 4 years ago. Updated over 4 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:95233]

Description

As I work with objects, some of them are not marshaled. Maybe there should be a method to tell whether an object is marshalable or not.

See below example:

hash = Hash.new {|h,k| k * 2}

this hash can't be marshaled because it has a default proc. If existing such method:

Marshal.marshalable?(hash) #=> method "Marshal.marshalable?"
hash.marshalable? #=> method "Kernel#marshalable?"

If you think the method name hard to spell, maybe get a synonym "dumpable?"

Thanks,

Matt
https://coding-bootcamps.com/
https://myhsts.org/
https://dcwebmakers.com/


Related issues 1 (1 open0 closed)

Is duplicate of Ruby master - Feature #4818: Add method marshalable?Assignedmatz (Yukihiro Matsumoto)Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0