Hi --

On Thu, 3 Jun 2004, Sam Sungshik Kong wrote:

> Thanks to all who replied to my question.
> 
> I want to mention one thing.
> One drawback of ruby's #{name} mechanism is that the variable 'name' must
> exist before I setup the format and another drawback is that when I setup
> the format the result string is already made (returned) and cannot be
> delayed (if I'm correct...).

I wouldn't describe it as a drawback, though; it's just what that
mechanism (interpolation) is.  It's different from placeholding a
variable name.  

In fact, #{var} is just one particular case of #{...}, where ... can
be any expression.  The whole thing is not designed around variables
and their names; it much more general.  And in a case like:

  puts "Two plus two is #{2+2}."

you can't have 2+2 not exist already :-)


David

-- 
David A. Black
dblack / wobblini.net