Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^25: Why? (each...)

by Argel (Prior)
on May 19, 2011 at 19:27 UTC ( [id://905789]=note: print w/replies, xml ) Need Help??


in reply to Re^24: Why? (each...)
in thread Why? (each...)

How is knowing that parens are used to override precedence helpful to someone that has trouble remembering whether to use %hash=(a=>1,b=>2) vs. %hash={a=>1,b=>2}?!? It's not. And so we are are still not on the same page. And like I said, we probably never will be, especially if you continue to be so hung up on black and white absolutes. I have explained several times now my viewpoint on this and at this point I can only conclude that gray areas like "indicate" are beyond your grasp. If I gave you "%hash=(" and asked you what you would normally expect to follow it what would your answer be? Something like "a=>1,b=>2)"? Edit: And if I gave you %hash=@" what would you expect to follow it? Something like "array"? So given the context, the opening paren does indicate (hint, suggest, pick a synonym) that a list will follow?

Elda Taluta; Sarks Sark; Ark Arks

Replies are listed 'Best First'.
Re^26: Why? (each...)
by ikegami (Patriarch) on May 19, 2011 at 21:31 UTC

    How is knowing that parens are used to override precedence helpful to someone that has trouble remembering whether to use %hash=(a=>1,b=>2) vs. %hash={a=>1,b=>2}?!?

    Straw man. The answer I gave to that is "One never uses {} or [] to initialise a hash or array"! I didn't mention parens at all in describing how to initialise a hash. After all, they've got nothing to do with it.

    I would mention them in describing how to build a list, though, because they are often needed around list literals.

    If I gave you "%hash=(" and asked you what you would normally expect to follow it what would your answer be? Something like "a=>1,b=>2)"??

    No. It's definitely a possibility, but I'd often be wrong if I would expect that.

      No it's not a strawman. It's the exact context of the question and confusion. He wasn't asking about it in a vacuum. He was asking about it in the context of %hash=(); or %hash={}, the mistake he made in the OP. That's the context your answer should be presented in!!

      And since when was "indicate" an absolute? "It's a possibility" could easily be rewritten as "likely indicates". I also do not think you would be wrong to expect it. "Expect" is not an absolute either. If 89% of the time that's how it plays out then why not expect it? It's like when CPU's predict the next set of instructions and cache those. Sometimes their expectations are not met, but often they are and we get a nice performance boost out of it. Or like when the boss expects good work from a long time employee with a history of producing good work. Heck, if a Lead is assigned to work on a project, that's a good indicator that it's either important or difficult (or both). We use expectations in our lives all of the time. I expect the bridge over the Missouri River here to hold up when I cross it. Update: Just like being 20+ levels deep is a good indicator this is waste of time! ;)

      Elda Taluta; Sarks Sark; Ark Arks

        Saying something occurred when it didn't just so you can shoot it down is the very definition of a straw man. I never answered that to that question.

        He was asking about it in the context of %hash=(); or %hash={}

        Yes, to which I said that {} does the wrong thing.

        I also pointed out that parens have nothing to do with hash initialisation, since he specifically asked about parens. Saying so is not out of context.

        And since when was "indicate" an absolute? "It's a possibility"

        That's not true. Indications aren't always correct, but "indicates a list" doesn't mean "indicates the possibility of a list". indicate

        Parens don't provide any information whatsoever about what's in the parens, not even information about the probability of what's in the parens. As such, parens don't point out the presence of a list or even the possibility of presence of a list. You'd have exactly the same information if the parens weren't there.

        In this context, «my %hash =» indicates a list. The «(» doesn't add any additional information whatsoever. Again, parens are not part of the answer at all. That's why I didn't mention them in context.

        If 89% of the time that's how it plays out then why not expect it?

        First, your number is completely made up.

        Secondly, you've just argued «"people surviving a jump off some building 89% of the time" indicates "people will survive a jump off that building"».

        Just like being 20+ levels deep is a good indicator this is waste of time! ;)

        I don't think helping people get the answers they want is a waste of time, but I don't know how I can do so here. Sorry I couldn't clear up your confusion.

        Parens don't indicate lists (as told by the three participants and which I showed by rebutting all your justifications).

        Parens have nothing to do with hash initialisation (despite your claims that saying so is out of context).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-26 02:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found