Luke Palmer wrote:
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?)

I think that's a bad kind of distinction, personally. It breaks an obvious parallel.

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.

Amen. Please don't steal unnecessary metacharacters in qq() strings--although I still think we should keep it, @ causes a lot of problems.

On the other hand, this is another step unifying strings and regexes. I
can say pretty confidently that that's a Good Thing.

The equivalent regex syntax isn't interpolating, even to the extent that a bare $foo or @bar is, so this would be sort of a "false cognate"--IMHO another reason not to have interpolating {}.

and what about "@a[1]('arg')[3]"?

That probably wouldn't.

Actually, I have to wonder why &foo('bar', 'baz') wasn't on Larry's list. Is there a reason for that?

(On the other hand, what will happen with HTML entities like   or
© if that *is* allowed?)

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


I would think you'd use a property:

    my @foo = (1,2,3,4,5) but separator('//');

Or maybe a trait:

    my @foo is separated('//') = (1,2,3,4,5);

Or perhaps even a (gasp!) attribute:

    my @foo = (1,2,3,4,5);
    @foo.separator='//';

Roles are nice, but don't forget about the other mechanisms in Perl for
such things.

[Forgot to send it to the list.  D'oh.]
[And then I sent it to the wrong one.  D'oh * 2.]

--
Brent "Dax" Royal-Gordon <[EMAIL PROTECTED]>
Perl and Parrot hacker

Oceania has always been at war with Eastasia.






Reply via email to