I was wondering what was the reasoning behind freezing the Memoizable return values? Thanks -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Aug 25, 3:32 am, trans <transf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I was wondering what was the reasoning behind freezing the Memoizable > return values? >to protect you from stuff like foo = bar.memoized_method foo.gsub!(...) #do something with foo If you did this and foo wasn''t frozen then you''d alter what memoized_method returned for all future calls - probably not what was intended Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Aug 25, 2:55 am, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> to protect you from stuff like > > foo = bar.memoized_method > foo.gsub!(...) > #do something with foo > > If you did this and foo wasn''t frozen then you''d alter what > memoized_method returned for all future calls - probably not what was > intendedMakes sense. Thanks. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.