On Sun, Jan 11, 2009 at 04:41:12PM -0800, Ovid wrote:
> I really don't think this is a bug, but it did confuse the heck out of me at
> first. This *is* expected behavior due to how {} is interpolated in strings,
> yes?
>
> $ perl6 -e 'my $foo = "foo";say "<" ~ $foo ~ ">"'
> <foo>
> $ perl6 -e 'my $foo = "foo";say "{" ~ $foo ~ "}"'
> ~ foo ~
I presume string interpolation is, er, "set-up", at compile-time.
So it only happened here because "{" ~ $foo ~ "}" was rewritten to
"{$foo}" at compile-time. And if "{" and "}" were replaced with
variables, for example, then the interpolation wouldn't have happened.
Right?
Tim.