What is the reason for the logical/defined or operators not to provide an lvalue as result?
I don't know. It may have been oversight, or there may have been an explicit or implicit rationale that has most likely been lost in the mists of time.
Would changing this behaviour break any existing code?
My first guess would be autovivification: $h{$_} behaves differently in lvalue and rvalue contexts, which is already enough to cause regular confusion. Also any classes that provide overloading of these operators is likely to have been designed to the current behaviour.
Is the usage of ${\(X // Y)} as an lvalue well-defined behaviour?
I think it probably depends on X and Y, but in the cases where it is legal to take the reference, I think I'd expect the dereference to be well-behaved. In other words: where it works, I wouldn't expect it to suddenly stop working.
In reply to Re: Logical/defined or as lvalue
by hv
in thread Logical/defined or as lvalue
by jo37
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |