Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: ref to read-only alias ... why? (not consistent)

by ikegami (Pope)
on Jan 06, 2012 at 18:33 UTC ( #946644=note: print w/ replies, xml ) Need Help??


in reply to Re^3: ref to read-only alias ... why? (not consistent)
in thread ref to read-only alias ... why?

Your right it's not consistent. But IMHO consistency will most likely break legacy code.

I think you're saying that because you envision it being consistently broken (always dying) instead of it being consistently fixed (never dying).

There are two ways of fixing it:

  • Have literal constants always return new values. That's inefficient.
  • Have literal constants return copy-on-write values. There's currently no such mechanism, and that's a lot of work to implement.

Check out this bug that would also be fixed by either of the above two fixes:

for (1..2) { for (1..3) { print $_++; } # 123 234 print "\n"; }


Comment on Re^4: ref to read-only alias ... why? (not consistent)
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2015-07-07 04:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls