From: "Abinoam Jr." Date: 2010-12-21T21:51:13+09:00 Subject: Re: Regexp, String, Symbol literals' object_ids [Advice... I'm new at this... be patient] Isn't it "%q" ? I couldn't figure out a "need" of this that wouldn't fit something like... holding_var = %q(string i do not want to be created again and again, and i do not want to define it as a constant because it is used once in a code) 5.times { puts "holding_var = #{holding_var} and its object_id is #{holding_var.object_id}" } If the string is short, you could even use a var name that ressembles the string. created_once = "created_once" Could you show an example? ("used once in a code" vs. "created again and again") Abinoam Jr. On Mon, Dec 20, 2010 at 6:50 PM, Pavel R. wrote: > Ok. But initial question was slightly different. > > Can I write something like > > %c(string i do not want to be created again and again, and i do not want > to define it as a constant because it is used once in a code) > > ? > > What is a reason if it is impossible in Ruby? It seems to be useful! > > -- > Posted via http://www.ruby-forum.com/. > >