in reply to Re^3: Logical/defined or as lvalue
in thread Logical/defined or as lvalue
... implementing the "Elvis operator" ... as $x ? $x : $y
Actually, I read the opposite from the Wiki article:
... the Elvis operator expression A ?: B is approximately equivalent to the ternary conditional expression A ? A : B
... something like ... x = f() ?: g() ... is equivalent to ... the conditional ternary operator x = f() ? f() : g() except that it does not evaluate f() twice if it yields truthy.
Accentuations by me.
Greetings,
🐻
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Logical/defined or as lvalue
by ikegami (Patriarch) on Sep 04, 2024 at 17:00 UTC | |
by jo37 (Curate) on Sep 04, 2024 at 18:36 UTC | |
by ikegami (Patriarch) on Sep 04, 2024 at 21:05 UTC |