Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^15: If you believe in Lists in Scalar Context, Clap your Hands

by ysth (Canon)
on Oct 28, 2008 at 18:37 UTC ( [id://720062]=note: print w/replies, xml ) Need Help??


in reply to Re^14: If you believe in Lists in Scalar Context, Clap your Hands
in thread If you believe in Lists in Scalar Context, Clap your Hands

No, I'm not confused. Operators do something and return something. This is both what happens and what appears to happen. The assignment operator gets the list on the right, it doesn't in any way produce or return it.
  • Comment on Re^15: If you believe in Lists in Scalar Context, Clap your Hands

Replies are listed 'Best First'.
Re^16: If you believe in Lists in Scalar Context, Clap your Hands
by mr_mischief (Monsignor) on Oct 28, 2008 at 18:44 UTC
    Who cares about the list on the right. What appears to happen to the list on the left? It appears to be yielded by the assignment. In fact, it is, but as a side effect.

        mr_mischief likes to think in a very right-to-left way when it comes to assignment operator. In his mental model,

        1. The list assignment operator returns two values to the list on its LHS, a list to assign and its scalar result.
        2. The LHS list takes the list returned by the list assignment and performs the assignment.
        3. The LHS list returns the scalar returned by the list assignment.

        He realizes the implementation differs.

        i am indeed talking about:
        The assignment operator itself happens to be both in scalar and in list context. It produces both a list for the list, and a scalar
        from 719455. The antecedent I intended for "it" was, however, "the assignment operator itself" and not the list on the right. In the "list for the list" part, the first "list" is the list value assigned through the side effect of the assignment operator and the second "list" is the list on the left which is assigned the value.

        I think that covers the possible misunderstandings. I'm sorry if I wasn't more clear, or if I still need to be more clear. I may have misunderstood which part you misunderstood.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://720062]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-25 05:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found