From: Nobuyoshi Nakada Date: 2007-09-06T17:06:18+09:00 Subject: Re: Symbols and frozen strings Hi, At Thu, 6 Sep 2007 16:50:28 +0900, Brian Candler wrote in [ruby-talk:267857]: > So I thought, wouldn't it be nice to have a half-way house: being able to > converting a symbol to a string, in such a way that you always got the same > (frozen) string object? Rather, Symbol#to_s should return frozen String? > I suppose that an instance variable lookup isn't necessarily faster than > always creating a temporary string with to_s and then garbage collecting it > at some point later in time, but it feels like it ought to be :-) > > However, since I've seen discussion about string modifiers like "..."u, > perhaps there's scope for adding in-language support, e.g. > > "..."f - frozen string, same object ID each time it's executed What about "..."o like Regexp? -- Nobu Nakada