At 11:17 AM 4/6/2001 -0700, Larry Wall wrote:
>Randal L. Schwartz writes:
>: >>>>> "Nathan" == Nathan Wiger <[EMAIL PROTECTED]> writes:
>:
>: Nathan> This is interesting, and in my gut I like it. Many people I've 
>worked
>: Nathan> with end up writing:
>:
>: Nathan>    @foo[0]
>:
>: Nathan> Which works.
>:
>: "Works", for some odd meaning of the word "works".  Ever try this:
>:
>:         @foo[0] = <STDIN>;
>:
>: and then wonder where all the *rest* of your input went?
>
>It's likely to work better in Perl 6.  To mean what it currently
>means, you'll probably have to write something like:
>
>         @foo[0] := <STDIN>;
>
>The colon here is not functioning merely to make the assignment look
>like Pascal.  It means, in this case, the following operator is
>intended to work on arrays, not scalars.  Hence, :+ would be pairwise
>array addition.

This is, I presume, in addition to any sort of inherent DWIMmery? I don't 
see any reason that:

    @foo[1,2] = <STDIN>;

shouldn't read just two lines from that filehandle, for example, nor why

    @bar = @foo * 12;

shouldn't assign to @bar all the elements of @foo multiplied by 12. (Though 
others might, of course)


                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to