On Wed, Jul 21, 2004 at 11:06:55PM +0200, Juerd wrote:
: Larry Wall skribis 2004-07-21 10:24 (-0700):
: > Interpolates
: > No Yes
: > -- ---
: > @foo @foo[1]
: > %bar %bar{"a"}
: > $foo.bar $foo.bar()
:
: Oh, please don't do that.
:
: Whatever interpolation thing is invented, make it SIMPLE. Allowing
: @foo[1], but not @foo is not simple.
It's "simple" in a different dimension, as the chart shows.
: In fact, with {}, is anything more than $foo and {} needed? Is $foo
: needed, even (I'd like to have it, because I dislike brackets
: everywhere)?
In theory we could require {} even on {$foo}. But we will certainly
allow bare $foo just because you asked for it. :-)
The rest is negotiable. I think we'll have riots if we don't at least
allow @foo[1] and %bar{"a"}. We've never allowed %foo by itself.
We allowed/required @foo to interpolate in Perl 5, and it catches a
certain number of people off guard regularly, including yours truly.
So I can argue [EMAIL PROTECTED] both ways.
We've never allowed methods or sub calls. We obviously can't
interpolate sigil-less foo(). We've flip-flopped about $foo.bar,
because it's definitely problematic either way. I still like my chart.
We could add another line to it that fits the same pattern:
No Yes
-- ---
@foo @foo[1]
%bar %bar{"a"} or %bar�a�
$foo.bar $foo.bar()
&foo &foo(1)
In this worldview, $foo is an exception only because it doesn't naturally
have a form that ends with some kind of bracket.
Larry