Null coalescing operator (original) (raw)

Property Value
dbo: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)
dbo:wikiPageID 12168753 (xsd:integer)
dbo:wikiPageLength 19897 (xsd:nonNegativeInteger)
dbo:wikiPageRevisionID 1115917106 (xsd:integer)
dbo:wikiPageWikiLink dbr:Babel_(compiler) dbr:PowerShell dbr:Bourne_shell dbr:Perl dbr:Visual_Basic_.NET dbr:?: dbr:Rust_(programming_language) dbr:SQLite dbr:Elvis_operator dbr:MySQL dbr:Conditional_operator dbr:Apache_FreeMarker dbc:Conditional_constructs dbr:C_Sharp_(programming_language) dbr:Transact-SQL dbr:TypeScript dbr:ECMAScript dbc:Operators_(programming) dbr:F_Sharp_(programming_language) dbr:PHP dbr:PL/SQL dbr:Conditional_(programming) dbr:ColdFusion dbr:Groovy_(programming_language) dbr:Haskell_(programming_language) dbr:JavaScript dbr:JavaScript_syntax dbr:Nullable_type dbc:Binary_operations dbr:Swift_(programming_language) dbr:PostgreSQL dbr:Ternary_operators dbr:Kotlin_(programming_language) dbr:Microsoft_SQL_Server dbr:Operator_(programming) dbr:Option_type dbr:Oracle_Database dbr:Railo dbr:CFML dbr:Side_effect_(computer_science) dbr:Programming_language dbr:NVL dbr:Tagged_union dbr:Null-conditional_operator dbr:Objective-C_(programming_language) dbr:Binary_operator
dbp:wikiPageUsesTemplate dbt:Code dbt:Short_description
dct:subject dbc:Conditional_constructs dbc:Operators_(programming) dbc:Binary_operations
gold:hypernym dbr:Operator
rdf:type dbo:Company yago:WikicatConditionalConstructs yago:Abstraction100002137 yago:Cognition100023271 yago:Concept105835747 yago:Content105809192 yago:Idea105833840 yago:PsychologicalFeature100023100
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)
rdfs:label Operátor koalescence (cs) Null coalescing operator (en) Null合体演算子 (ja) 空值结合运算符 (zh)
owl:sameAs freebase:Null coalescing operator yago-res:Null coalescing operator wikidata:Null coalescing operator dbpedia-cs:Null coalescing operator dbpedia-hr:Null coalescing operator dbpedia-ja:Null coalescing operator dbpedia-tr:Null coalescing operator dbpedia-zh:Null coalescing operator https://global.dbpedia.org/id/3E9z4
prov:wasDerivedFrom wikipedia-en:Null_coalescing_operator?oldid=1115917106&ns=0
foaf:isPrimaryTopicOf wikipedia-en:Null_coalescing_operator
is dbo:wikiPageDisambiguates of dbr:Or
is dbo:wikiPageRedirects of dbr:/= dbr:Comparison_of_programming_languages_(null_coalescing_operators) dbr:Defined-or_operator dbr:Null-coalescing_operator dbr:Nullish_coalescing_operator dbr:??_Operator dbr:??_operator dbr:Coalescing_Operator dbr:Logical_Defined-Or dbr:Logical_Defined-Or_operator dbr:Logical_defined-or dbr:Logical_defined-or_operator
is dbo:wikiPageWikiLink of dbr:PowerShell dbr:Question_mark dbr:Null_object_pattern dbr:?? dbr:/ dbr:/= dbr:Comparison_of_programming_languages_(null_coalescing_operators) dbr:Elvis_operator dbr:Or dbr:Coalesce dbr:C_Sharp_syntax dbr:Lazy_loading dbr:ECMAScript dbr:PHP dbr:JavaScript_syntax dbr:Nullable_type dbr:C_Sharp_2.0 dbr:Kotlin_(programming_language) dbr:Operator_(computer_programming) dbr:Safe_navigation_operator dbr:PHP_syntax_and_semantics dbr:Ternary_conditional_operator dbr:Defined-or_operator dbr:Null-coalescing_operator dbr:Nullish_coalescing_operator dbr:??_Operator dbr:??_operator dbr:Coalescing_Operator dbr:Logical_Defined-Or dbr:Logical_Defined-Or_operator dbr:Logical_defined-or dbr:Logical_defined-or_operator
is foaf:primaryTopic of wikipedia-en:Null_coalescing_operator