in reply to Re^7: Shouldn't references be readonly? (updated)
in thread Shouldn't LITERAL references be readonly? (updated)
Making the var read-only won't prevent concatenation or addition, so it doesn't matter that $x . [] or $x + [] doesn't make sense.[1]. This isn't relevant to the topic at hand.
The only thing making it read-only will do is prevent assignment, and map { $_ = 3 } $x.$y makes no more sense than map { $_ = 3 } [].
Either prevent both of them, or prevent neither of them. No need for baseless inconsistencies.
- That said, $ref+0 makes some sense for refs to things other than objects with overloads, and both concatenation and addition make sense for refs to objects with overloads (which aren't farfetched at all!)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^9: Shouldn't references be readonly? (updated)
by ikegami (Patriarch) on Aug 09, 2020 at 07:12 UTC | |
Re^9: Shouldn't references be readonly? (updated)
by LanX (Saint) on Aug 09, 2020 at 12:46 UTC | |
by ikegami (Patriarch) on Aug 09, 2020 at 21:19 UTC | |
by Corion (Patriarch) on Aug 10, 2020 at 06:08 UTC | |
by ikegami (Patriarch) on Aug 11, 2020 at 10:39 UTC | |
by LanX (Saint) on Aug 11, 2020 at 15:13 UTC | |
by ikegami (Patriarch) on Aug 09, 2020 at 21:07 UTC | |
by LanX (Saint) on Aug 09, 2020 at 23:45 UTC |
In Section
Seekers of Perl Wisdom