Is there an easy way to test whether an object is a immutable (numbers, nil) or not (Array, Hash, objects)? In other words, could it be changed by side effects from other code?
Motivation: I want to create a versioned value store, but some of the data is arrays. Some of the arrays will store custom objects, and I could invert the relationship by storing the 'in' property and searching for it. But I'd also like to be able to store arrays of symbols, other arrays, etc.