From: John Carter Date: 2008-08-29T11:07:29+09:00 Subject: Re: Immutable Ruby On Fri, 29 Aug 2008, Trans wrote: > I was thinking about Erlang a bit today, the fact that it's objects > are all immutable and it's usefulness to concurrency. So I began to > wonder, what would an Immutable Ruby look like? > > * Would it make setter methods effectively pointless? The notion of a setter is probably very problematic. > * Overall, would it help or hurt efficiency/speed? Depends on a single processor slower, on a high concurrency N core processor, faster. > * Would it ruin Ruby's elegance? Yes, no. It becomes conceptually cleaner. The garbage collection becomes cleaner and easier. I suspect it will force you to think to really really think about which class owns which other class. > * No more #<< :( Nor any ! method. > * Is such a thing even possible? Sort like Star Trek... "It's life Jim, but not as we know it" To find out what it would be like replace every Blah.new(arg1,arg2...) with Blah.new(arg1,arg2...).freeze John Carter Phone : (64)(3) 358 6639 Tait Electronics Fax : (64)(3) 359 4632 PO Box 1645 Christchurch Email : john.carter@tait.co.nz New Zealand