From: Magnus Holm Date: 2013-09-15T13:22:29+02:00 Subject: [ruby-core:57216] Re: [ruby-trunk - Feature #8909] Expand "f" frozen suffix to literal arrays and hashes --001a11c34f5ccf649d04e66a4ed0 Content-Type: text/plain; charset=UTF-8 On Sun, Sep 15, 2013 at 1:01 PM, headius (Charles Nutter) < headius@headius.com> wrote: > > Issue #8909 has been updated by headius (Charles Nutter). > > > FWIW, I would still optimize frozen-arrays-of-literals to always return > the same object, and frozen empty arrays and hashes would be the same > object everywhere, but the expression nature of the array elements means > this would be an unspecified characteristic of the feature. So we can abuse this to cache a value? res = [expensive_call(123)]f p res[0] --001a11c34f5ccf649d04e66a4ed0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Sun, Sep 15, 2013 at 1:01 PM, headius (Charles Nutter) = <headius@headius.com> wrote:

Issue #8909 has been updated by headius (Charles Nutter).


FWIW, I would still optimize frozen-arrays-of-literals to always return the= same object, and frozen empty arrays and hashes would be the same object e= verywhere, but the expression nature of the array elements means this would= be an unspecified characteristic of the feature.

So we can abuse this to cache a value?

=C2=A0 res =3D [expensive_call(123)]f
=C2=A0 p res[0]
--001a11c34f5ccf649d04e66a4ed0--