From: Robert Dober Date: 2007-05-19T14:49:19+09:00 Subject: Re: Why was the "Symbol is a String"-idea dropped? On 5/18/07, Rick DeNatale wrote: > On 5/18/07, Robert Dober wrote: > > On 5/18/07, Rick DeNatale wrote: > > > On 5/18/07, Paul Brannan wrote: > > > > On Fri, May 18, 2007 at 03:17:01AM +0900, dblack@wobblini.net wrote: > > > > > Yes, it's the immutable/immediate thing that symbols have in common > > > > > with fixnums and that neither has in common with strings. > > > > > > > > Frozen strings are immutable. > > > > > > But not immediate. > > > > > > > What about > > > > %f{This is sooo cooooold} << "!" > > > > TypeError: can't modify frozen string > > Just an idea. > > That's the immutable part, but > > a = "abc".freeze > b = "abc".freeze > c = :abc > d = :abc > a.object_id => -606341628 > b.object_id => -606347008 > c.object_id => 343218 > d.object_id => 343218 > > The key difference is that there's only one instance of a symbol with > a given string representation. Ah I see, I got confused, I did not understand the meaning of immediate immediately ;). Although theoretically the interpreter could create an immediate value for %f{...} we would probably run out of address space :( > Cheers Robert -- You see things; and you say Why? But I dream things that never were; and I say Why not? -- George Bernard Shaw