Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^5: shift in list context buggy?

by BrowserUk (Pope)
on Nov 12, 2013 at 15:24 UTC ( #1062216=note: print w/ replies, xml ) Need Help??


in reply to Re^4: shift in list context buggy?
in thread shift in list context buggy?

splice doesn't even mention "void".

No, but the equivalence documentation you cite shows all examples in void contexts.

And in that context, the examples -- designed to explain the somewhat complex behaviour of splice in terms of the readily understandable push, pop, shift & unshift -- are exactly equivalent. Ie. Their affect on the running programs are identical.

But those examples are meant to explain splice in terms of the simpler operations -- not the other way around.

You are the only person who is trying to misinterpret these simple examples of equivalence within the very restricted context in which they are show -- all void; ie. devoid of any assignments or if or while statements -- in an obscure part of the documentation, to be some definitive statement that was never intended, in support of conclusions that do not stand up and have zero merit.

Worse thing is; you know it; but you keep on bleating away at it....


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re^5: shift in list context buggy?
Re^6: shift in list context buggy?
by LanX (Canon) on Nov 12, 2013 at 15:33 UTC
    > No, but the equivalence documentation you cite shows all examples in void contexts.

    Obviously wrong!

    Again! Please quote otherwise and provide a link!

    Cheers Rolf

    ( addicted to the Perl Programming Language)

      Please quote ...

      Why? You already posted the examples. But since you seem to have a short memory:

      The following equivalences hold (assuming $[ == 0 and $#a >= $i ) push(@a,$x,$y) splice(@a,@a,0,$x,$y) pop(@a) splice(@a,-1) shift(@a) splice(@a,0,1) unshift(@a,$x,$y) splice(@a,0,0,$x,$y) $a[$i] = $y splice(@a,$i,1,$y)

      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
      div class=
        LOL, are you serious? :)

        splice explicitly talks about list and scalar context and shows later an equivalence table w/o mentioning void-context.

        The intention is obviously to cover all contexts.

        Cheers Rolf

        ( addicted to the Perl Programming Language)

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-08-01 06:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (257 votes), past polls