On 10/9/06, Jonathan Lang <[EMAIL PROTECTED]> wrote:
Smylers wrote:
> To be consistent your proposal should also suggest that these become
> equivalent:
>
> * "{ function() }"
> * qq[ {function() }]
> * qq{ function() }
> * eval "function()"

How so?  AFAIK, string literal syntax requires you to prepend a sigil
on the front of any embedded closure that you want to interpolate a
value from; otherwise, it isn't a closure - it's just a pair of
curly-brace characters.  My proposal isn't "curly braces _always_ act
like closures, no matter what"; it's "the second part of a s[]
construct doesn't have to be a literal; it can be anything that can be
evaluated as needed by the algorithm to provide substitute text."

According to S02 bare curlies do interpolate in double-quoted strings:

S02> =item *
S02>
S02> A bare closure also interpolates in double-quotish context.  It may
S02> not be followed by any dereferencers, since you can always put them
S02> inside the closure.  The expression inside is evaluated in scalar
S02> (string) context.  You can force list context on the expression using
S02> the C<list> operator if necessary.

--
Markus Laire

Reply via email to