in reply to Re: Conditinal array initialisation?
in thread Conditional array initialisation?
That it doesn't work is clear.
But, the semantics seem very clear, and the implementation trivial (roughly, without the need for copying):
undef @a; @a = @a ? @a : (1..3); say @a;; 1 2 3 @a = (4..6); @a = @a ? @a : (1..3); say @a;; 4 5 6
So I wondered why it isn't implemented so?
|
|---|