On Mon, Sep 16, 2013 at 3:53 AM, Nobuyoshi Nakada <nobu / ruby-lang.org> wrote:
> (13/09/16 3:29), headius (Charles Nutter) wrote:
>> @matz What I mean is that all of the following could safely be optimized to return the same object every time:
>>
>> []f
>> {}f
>> [:foo, 1, 1.5, true, nil]
>
> Note that we have to freeze true, false, and nil too, for the last
> expression.

true, false, and nil exist as unique objects, so whether they're
frozen or not does not matter here. Two arrays that contain the same
objects and which cannot be modified are equivalent.

That said, I have and will continue to support all literal,
naturally-immutable values being frozen by default (Symbol, Fixnum,
Float, Bignum, true, false, nil) and values that *should* be immutable
being frozen as well (Time, Rational, Complex, BigDecimal).

- Charlie