in reply to Re: Some Insights from a Traveler Between Languages
in thread Some Insights from a Traveler Between Languages

Yeah, I totally dropped the ball on the third example. It was careless of me to use the values (1, 2, 3) as that was a mine field of coincidence and I paid the price in looking the fool. As for the fourth case, though, I really can't imagine why we would want such a thing. Surely it's not a terrible burden to have to put parentheses around the stuff you are assigning to the array.
  • Comment on Re^2: Some Insights from a Traveler Between Languages

Replies are listed 'Best First'.
Re^3: Some Insights from a Traveler Between Languages
by chromatic (Archbishop) on Apr 23, 2005 at 23:00 UTC
    Surely it's not a terrible burden to have to put parentheses around the stuff you are assigning to the array.

    Then do.

    I don't because it's unnecessary. Except for slicing the values returned from a function and creating a one-element lvalue list, I cannot think of a case where parentheses create lists. (I can also argue that in the former case, they don't either; they just mark a context.)

    Put another way, if there are no precedence issues, why do you need to group a one-element list explicitly?

      I think that's skirting my main issue, though. Namely, I find it troublesome that it makes such a simple mistake so eminently possible. The fact that you have two ways of saying something and one of those two ways is extremely close to a totally different semantic meaning is just asking for trouble.

      Does the parenthesis in (EXPR) x EXPR create a list (in list context)?

      ihb

      See perltoc if you don't know which perldoc to read!

        It creates list context for the x operator, which causes a list to be created.

        Caution: Contents may have been coded under pressure.