------art_7642_32526587.1232315878771
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

2009/1/18 Raj Singh <neeraj.jsr / gmail.com>

> >> c1  hello'
> >> eval c1
> NameError: undefined local variable or method `hello' for main:Object
>
> >> c2  hello #{hi}'
> "hello \#{hi}"
> >> eval c2
> NameError: undefined local variable or method `hello' for main:Object
>
> >> c3  #{hi} hello'
> "\#{hi} hello"
> >> eval c3
> nil
>
>
> My question is why the eval of c3 is returning nil. It should fail
> saying that undefined local variable just as it did in the case of c2 ?


It's evaluated as a comment:
#hi hello
If you want #{hi} to be replaced by the content of the variable hi, you
should use double quotes:
c4  #{hi} hello"

------art_7642_32526587.1232315878771--