in reply to Re^17: ref to read-only alias ... why? (notabug)
in thread ref to read-only alias ... why?

Ok, I agree about for (1..3), that's reasonable. But I don't agree on this:

There was code written to specifically perform this effect. By definition, the effect must be intentional.

If it were true, why then threaded and non-threaded perl give different results in \ $_[0] ? Was that also intentional? Even if it was, that's bad intention to me, and bad design. A bug, basically.

  • Comment on Re^18: ref to read-only alias ... why? (notabug)

Replies are listed 'Best First'.
Re^19: ref to read-only alias ... why? (notabug)
by ikegami (Pope) on Jan 09, 2012 at 18:15 UTC

    If it were true, why then threaded and non-threaded perl give different results in \ $_[0] ?

    I don't know why that code isn't reached for non-threaded Perls.

    Even if it was, that's bad intention to me, and bad design. A bug, basically.

    You're wrong to simply declare that it's a design flaw.

    Three people in this thread and many of the core Perl5 developers (if not all) know that it's not self-evident that literals should create non-modifiable values.

    You're wrong to simply declare that it's a bug.

    It's only a bug if it doesn't behave as intended, and some of the core Perl5 developers have explicitly stated they believe literals should return modifiable values.

    I was hoping you'd come around to expressing an opinion or making an argument, but all we got were empty declarations.

      ...many of the core Perl5 developers (if not all) know that it's not self-evident that literals should create non-modifiable values. You're wrong to simply declare that it's a bug.

      I'd like a proof to that statement. My arguments, on the contrary are quite simple: the behavior is not documented, the behavior is inconsistent. If that doesn't qualify for a bug, then I don't know what does. If you can prove that the behavior is documented, and that it is consistent, please do.

      some of the core Perl5 developers have explicitly stated they believe literals should return modifiable values.

      Proof please. Again, my proof is that Arthur Bergman, the person who answered to the bug some 8 years ago, said it's a bug. https://rt.perl.org/rt3/Ticket/Attachment/55414/41707/

      I was hoping you'd come around to expressing an opinion or making an argument, but all we got were empty declarations.

      I'm sorry, but empty declarations are on your side :) You didn't provide neither proof in docs/code, nor references in support to the claims that many (how many "many" btw? "many" as in "one-two-many"?) devs support your claims. Please, either show hard facts or admit that you have none.

      I'm ready to accept your point of view, but you need to corroborate it.

        I'd like a proof to that statement.

        There are comments on RT#3105 that were posted on p5p (but off-ticket) about this. Also, COW came up again recently on p5p. It's a publicly readable and searchable mailing list. I don't have time to search right now (Took me a couple days just to get around to writing this!) I'll try when I can.

        my proof is that Arthur Bergman, the person who answered to the bug some 8 years ago, said it's a bug.

        Just like him, I agree the inconsistency is a bug. I only have a problem with your fix. I have already explained how I think your fix only affects the case that is working correctly.

        how many "many" btw? "many" as in "one-two-many"?

        Considering there's only a couple of handful of them in total, and how few speak on topics they aren't working on...

        You didn't provide neither proof in docs/code,

        To my knowledge, the docs are silent on whether literals should return read-only values or modifiable values. Which is why I provided code (contrary to what you said).

      Well you already agreed that it is inconsistent.

      And for some people - including me - inconsistencies are a special quality of bugs. (maybe the worst)

      OTOH I'm well aware that it's not possible to simply redesign implementations w/o breaking other code depending on old behavior.

      So it's a matter of best compromise - like emitting warnings.

      Cheers Rolf