Issue #11734 has been updated by Koichi Sasada.

Status changed from Open to Closed

----------------------------------------
Feature #11734: Improved ternary operator
https://bugs.ruby-lang.org/issues/11734#change-55298

* Author: Yurko Bregey
* Status: Closed
* Priority: Normal
* Assignee: 
----------------------------------------
In ternary operator it would be nice to be able to pass expression result from *condition*  into *value_if_true/value_if_false* in such way:

`some_long_expression ? &.to_s : 'foobar'`
where `&` refers to `some_long_expression`

Instead of doing:
`some_long_expression ? some_long_expression.to_s : 'foobar'`

or:
`result = some_very_very_long_expression
result ? result.to_s : 'foobar'`



-- 
https://bugs.ruby-lang.org/