From: Austin Ziegler Date: 2005-01-14T23:29:20+09:00 Subject: Re: Mutable strings On Fri, 14 Jan 2005 14:00:07 +0900, Mystifier wrote: > Dear Charles, > > I have no intensions of changing the language APIs for it really > does not matter to a VM Implementation. All the components that > inherently affects the VM implementations are those that VM uses > natively like File, Strings, Numbers and Threads. > > I surprisingly found Symbols are exactly not Immutable...., they > are just like any other class Um. That's not the same at all. Symbols themselves are immutable. The Symbol Class is not immutable. Yes, this means that someone could override #to_s on Symbol to do something else entirely, but Symbols themselves are immutable -- and they cannot have virtual (singleton) classes: irb(main):001:0> foo = :foo => :foo irb(main):002:0> class << foo irb(main):003:1> end TypeError: no virtual class for Symbol from (irb):2 irb(main):004:0> There is a significant difference between the two sorts of immutability that you would be advised to understand before even thinking of attempting to implement a VM to support Ruby. -austin -- Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca