Alexey Trofimenko writes: > On Tue, 20 Jul 2004 16:06:40 -0700, Larry Wall <[EMAIL PROTECTED]> wrote: > >So all of these would require curlies: > > > > {foo()} > > [EMAIL PROTECTED] > > ... > > ah.. how poorly.. and how sufficient!.. But it's.. it's just not quite > like in perl5.. But I can adopt myself. :) I doubt about "@arr" disabling, > but {} interpolator is cool!
This doesn't quite feel right to me. I was really a big fan of the good ol' Perl 6 days where you could interpolate as in Perl 5, and method calls required parentheses. I understand why Larry wanted to take out the parentheses, though... or rather why I'd want to take out the parentheses if I were him. It's so that people would stop thinking of $foo.bar as a method call, and more as an attribute. Or just more abstractly -- less procedurally -- in general. This I'm all for. But then making them interpolate without parens get's a little to "loose" for my tastes. Perl's then come to the point of doing too much for me, and I want it to just sit down and shut up. I admit there's a certain interest to Larry's new idea. I've been looking for more distinction between $, @, and % in Perl 6, since they start to become mostly irrelavent. In the new proposal: my @a = (1,2,3,4,5); my $a = @a; say "@a"; # @a say "$a"; # 1 2 3 4 5 (perhaps?) But I'll admit that I'm much more a fan of $() and @() than I am of {}. Form.pm would get very angry at this decision indeed. On the other hand, this is another step unifying strings and regexes. I can say pretty confidently that that's a Good Thing. On the mutant growth hand, it's just too weird. Come on, just be conservative (or liberal, depending on whether you're talking culturally or syntactically)! It was pretty good before. With $() and @(), it's better than before. > (hm.. looks like Perl6 will not require special HTML templating packages > in 90% cases.. qq[ <tag attr={.property}> ] would be enough for me almost > always) > > some questions: > > 1) is "@a[1][2]{'a'}ÂbÂ" interpolateable? I should hope that Larry hasn't gone completely insane (or should I say "more insane" ;-). That ought to work. > and what about "@a[1]('arg')[3]"? That probably wouldn't. > 2) what's the default separator for list interpolation? > "{1,2,3}" eq "123" or > "{1,2,3}" eq "1 2 3" ? I definitely liked space as in Perl 5. It was the simplest thing that you could pick: perfectly clear where the elements are. > and is there any way to redefine it, as assigment to perl5 @" does? I > can't figure to which object or class that property could belong, so maybe > there should be just lexically scoped pragma... The New Way (tm) to do that would probably be sticking a role onto the array object with which you're dealing: my @foo does separator('//') = (1,2,3,4,5); say "[EMAIL PROTECTED]"; # 1//2//3//4//5