| [reply] [Watch: Dir/Any] |
Could you please clarify which the "working case" is in your opinion?
It shouldn't matter whether your scalar was created by «my $x» or by «123». The literal «123» should return a modifiable value. The code in \ is specifically there to emulate that without the cost of creating a new scalar every time «123» is evaluated.
I agree with tye that there are good arguments for both perspectives.
I can't find these arguments. Could you give me a link?
| [reply] [Watch: Dir/Any] [d/l] [select] |
The literal «123» should return a modifiable value.
Could you elaborate on that please? I don't find that neither convincing nor intuitive. If that's true, why error message "Modification of a read-only value" exists at all? By the same logic 123++ should be working fine, no?
| [reply] [Watch: Dir/Any] |
> I can't find these arguments. Could you give me a link?
He didn't list many arguments, thats the link: Re^3: ref to read-only alias ... why? (notabug)
> It shouldn't matter whether your scalar was created by «my $x» or by «123».
So your POW is that the standard behavior is wrong, such that in my code-example inc_a() should better also act like inc_b()?
Without really understanding the opcode-level I'm wondering why you say that either behaviors are difficult to implement if both already exist.
IMHO there should always be a configurable (i.e. switchable) warning because different people expect different behavior.
| [reply] [Watch: Dir/Any] [d/l] [select] |