[#106355] [Ruby master Bug#18373] RBS build failure: '/include/x86_64-linux/ruby/config.h', needed by 'constants.o'. — "vo.x (Vit Ondruch)" <noreply@...>
Issue #18373 has been reported by vo.x (Vit Ondruch).
28 messages
2021/12/01
[ruby-core:106889] [Ruby master Feature#18332] a ? b
From:
"nobu (Nobuyoshi Nakada)" <noreply@...>
Date:
2021-12-29 04:38:44 UTC
List:
ruby-core #106889
Issue #18332 has been updated by nobu (Nobuyoshi Nakada).
`??` is a character literal.
As omitting the `:` and after makes the syntax value conflicting of course, I don't think this is acceptable.
----------------------------------------
Feature #18332: a ? b
https://bugs.ruby-lang.org/issues/18332#change-95694
* Author: dorianmariefr (Dorian Mari辿)
* Status: Open
* Priority: Normal
----------------------------------------
It would be a shortcut for `a ? b : nil`:
e.g.
```
"#{current_path == "/" ? "font-bold"}"
"#{user.admin? ? "text-red-600"}"
```
Doing `a && b` returns `false` which converted to a string gives `"false"`.
When `nil` converts to a string it gives `""`.
I would use it mostly in string interpolations.
--
https://bugs.ruby-lang.org/
Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>