Gary Wright
1/16/2009 6:23:00 PM
On Jan 16, 2009, at 10:41 AM, Raj Singh wrote:
> x = 'hello'
> y = '#{x} world'
>
> desired result = 'hello world'
This might not be exactly what you were asking for but might be
helpful none the less:
x = 'hello'
lazy = lambda {"#{x} world"}
result = lazy.call
result = lazy[]
# or maybe even..
def lazy.to_s
call
end
puts lazy # hello world
x = 'goodbye'
puts lazy # goodbye world