On Wed, 2005-02-09 at 06:04, Rod Adams wrote:
> Larry Wall wrote:
> >Yes, you can certainly intermix them as long as you keep your
> >precedence straight with parentheses. Though I suppose we could go
> >as far as to say that = is only scalar assignment, and you have to
> >use <== or ==> for list assignment. That would be...interesting...to
> >say the least. For instance, it would eliminate the guessing games
> >about whether the syntactic form of the left side indicates a list.
> >Doubtless there would be some downsides too...
> Issues that arise (my mind has yet to settle enough to label them
> "downsides"):
>
> - List assignment is way too common to inflict a three char operator on,
> especially one that really likes having \S around it. (But don't ask me
> what else to use, not much is left available.) At least, it's way too
> common for me.
Yeah, well I always thought []= made more sense anyway :)
DISCLAIMER: I've been off perl6-* for a bit, and might not have my
syntax right here. Sorry.
There are a few ways to short-cut that. First off, you could (either
in-core, or in a module) set this up:
@x.(@y);
This is legit syntax today AFAIK, but has no plausible meaning that I
can figure out. It's still 3 characters, but eliminates any whitespace
ambiguity.
Ok, so the next method would be:
[EMAIL PROTECTED] = [EMAIL PROTECTED];
What does that do today? Is it legit? Again, 3 chars, but no
ambiguity....
So hold on to your socks... what about:
@x @y;
Hey, if you're going to Huffman the syntax... But stay with me. This is
simply a matter of verbing the @x, which would have the same effect as:
@x.(@y);
and we discussed what that would mean, above. This has some nice
ramifications:
my @x 1, 2, 3; # Initialize @x with list of numbers
my @x foo(); # enforce scalar context on foo() and store
@x @y @z; # Chaining
--
â 781-324-3772
â [EMAIL PROTECTED]
â http://www.ajs.com/~ajs