Project

General

Profile

Feature #16240

Are all objects and methods marshalable

Added by mattumd (Matt Zand) about 2 months ago. Updated about 2 months ago.

Status:
Rejected
Priority:
Normal
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

Is duplicate of Ruby master - Feature #4818: Add method marshalable?AssignedActions

History

#1

Updated by mame (Yusuke Endoh) about 2 months ago

Also available in: Atom PDF