The null coalescing operator (called the Logical Defined-Or operator in Perl) is a binary operator that is part of the syntax for a basic conditional expression in several programming languages, including C#, PowerShell as of version 7.0.0, Perl as of version 5.10, Swift, and PHP 7.0.0. While its behavior differs between implementations, the null coalescing operator generally returns the result of its left-most operand if it exists and is not null, and otherwise returns the right-most operand. This behavior allows a default value to be defined for cases where a more specific value is not available.
Attributes | Values |
---|
rdf:type
| |
rdfs:label
| - Operátor koalescence (cs)
- Null coalescing operator (en)
- Null合体演算子 (ja)
- 空值结合运算符 (zh)
|
rdfs:comment
| - Operátor koalescence je v mnoha programovacích jazycích operátor, který vrací první z dodaných odkazů, který označuje platný objekt. Někdy bývá označován také jako operátor nulového sjednocení. (cs)
- null合体演算子 (null coalescing operator) はC#やバージョン5.10以降のPerl、Swiftなど、いくつかのプログラミング言語に存在する、ある種の条件演算子で、PerlではDefined-or 演算子と呼ばれる。エルビス演算子も参照。C言語の3項演算子 ? : で表現すると ( (a != null) ? a : b ) というような意味のコードをより単純に書ける、一種の糖衣構文と見ることもできる。 (ja)
- 空值结合运算符(在Perl中称逻辑定义或运算符)是一种二元运算符,是多种编程语言的基本条件表达式语法的一部分,包括C#、PowerShell 7.0.0、Perl 5.10,Swift,PHP 7.0.0。虽然其行为因实现而异,但空值合并运算符首先考虑返回其左操作数的值(如果左操作数存在且不为空) ,其次考虑返回右操作数的值。此行为可为特定值不可用的情况定义缺省值。 与三元条件表达式 x?x:y中表达式x可能求值2次相比,空值结合运算符更类似二元埃尔维斯运算符x?:y,操作数求值至多一次,这在x的求值有副作用情况下特别有意义。 (zh)
- The null coalescing operator (called the Logical Defined-Or operator in Perl) is a binary operator that is part of the syntax for a basic conditional expression in several programming languages, including C#, PowerShell as of version 7.0.0, Perl as of version 5.10, Swift, and PHP 7.0.0. While its behavior differs between implementations, the null coalescing operator generally returns the result of its left-most operand if it exists and is not null, and otherwise returns the right-most operand. This behavior allows a default value to be defined for cases where a more specific value is not available. (en)
|
dcterms:subject
| |
Wikipage page ID
| |
Wikipage revision ID
| |
Link from a Wikipage to another Wikipage
| |
sameAs
| |
dbp:wikiPageUsesTemplate
| |
has abstract
| - Operátor koalescence je v mnoha programovacích jazycích operátor, který vrací první z dodaných odkazů, který označuje platný objekt. Někdy bývá označován také jako operátor nulového sjednocení. (cs)
- The null coalescing operator (called the Logical Defined-Or operator in Perl) is a binary operator that is part of the syntax for a basic conditional expression in several programming languages, including C#, PowerShell as of version 7.0.0, Perl as of version 5.10, Swift, and PHP 7.0.0. While its behavior differs between implementations, the null coalescing operator generally returns the result of its left-most operand if it exists and is not null, and otherwise returns the right-most operand. This behavior allows a default value to be defined for cases where a more specific value is not available. In contrast to the ternary conditional if operator used as x ? x : y, but like the binary Elvis operator used as x ?: y, the null coalescing operator is a binary operator and thus evaluates its operands at most once, which is significant if the evaluation of x has side-effects. (en)
- null合体演算子 (null coalescing operator) はC#やバージョン5.10以降のPerl、Swiftなど、いくつかのプログラミング言語に存在する、ある種の条件演算子で、PerlではDefined-or 演算子と呼ばれる。エルビス演算子も参照。C言語の3項演算子 ? : で表現すると ( (a != null) ? a : b ) というような意味のコードをより単純に書ける、一種の糖衣構文と見ることもできる。 (ja)
- 空值结合运算符(在Perl中称逻辑定义或运算符)是一种二元运算符,是多种编程语言的基本条件表达式语法的一部分,包括C#、PowerShell 7.0.0、Perl 5.10,Swift,PHP 7.0.0。虽然其行为因实现而异,但空值合并运算符首先考虑返回其左操作数的值(如果左操作数存在且不为空) ,其次考虑返回右操作数的值。此行为可为特定值不可用的情况定义缺省值。 与三元条件表达式 x?x:y中表达式x可能求值2次相比,空值结合运算符更类似二元埃尔维斯运算符x?:y,操作数求值至多一次,这在x的求值有副作用情况下特别有意义。 (zh)
|
gold:hypernym
| |
prov:wasDerivedFrom
| |
page length (characters) of wiki page
| |
foaf:isPrimaryTopicOf
| |
is Link from a Wikipage to another Wikipage
of | |