[Rails] Re: Why freeze memoization?

2010-09-19 Thread trans
On Aug 25, 2:55 am, Frederick Cheung 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 > intended

[Rails] Re: Why freeze memoization?

2010-08-24 Thread Frederick Cheung
On Aug 25, 3:32 am, trans 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_metho