in reply to Re^3: RFC: "assignary" operator ?= :
in thread RFC: "assignary" operator ?= :
Yes with a properly named custom-function operating on an alias.init $var1 => 'value1'; # pretty elegant, right?
No, not at all. First, init() is a poor name which doesn't, by name, tell at all what it is doing. Second, the sub you wrote isn't at all ternary in any way, since it misses $_[2]. Third and last, function LIST doesn't tell at first glance that it is about conditional assignment to $_[0] from either $_[1] or $_[2] based on defined-ness of $_[0].
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: RFC: "assignary" operator ?= :
by LanX (Saint) on Dec 07, 2019 at 18:01 UTC |