About: Null coalescing operator   Goto Sponge  NotDistinct  Permalink

An Entity of Type : yago:Concept105835747, within Data Space : wasabi.inria.fr associated with source document(s)

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.

AttributesValues
type
label
  • Null coalescing operator
  • Null合体演算子
  • Operátor koalescence
  • 空值结合运算符
comment
  • null合体演算子 (null coalescing operator) はC#やバージョン5.10以降のPerl、Swiftなど、いくつかのプログラミング言語に存在する、ある種の条件演算子で、PerlではDefined-or 演算子と呼ばれる。エルビス演算子も参照。C言語の3項演算子 ? : で表現すると ( (a != null) ? a : b ) というような意味のコードをより単純に書ける、一種の糖衣構文と見ることもできる。
  • 空值结合运算符(在Perl中称逻辑定义或运算符)是一种二元运算符,是多种编程语言的基本条件表达式语法的一部分,包括C#、PowerShell 7.0.0、Perl 5.10,Swift,PHP 7.0.0。虽然其行为因实现而异,但空值合并运算符首先考虑返回其左操作数的值(如果左操作数存在且不为空) ,其次考虑返回右操作数的值。此行为可为特定值不可用的情况定义缺省值。 与三元条件表达式 x?x:y中表达式x可能求值2次相比,空值结合运算符更类似二元埃尔维斯运算符x?:y,操作数求值至多一次,这在x的求值有副作用情况下特别有意义。
  • 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.
  • 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í.
sameAs
topic
described by
subject
dbo:wikiPageID
Wikipage revision ID
dbo:wikiPageWikiLink
Faceted Search & Find service v1.13.91 as of Mar 24 2020


Alternative Linked Data Documents: Sponger | ODE     Content Formats:       RDF       ODATA       Microdata      About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data]
OpenLink Virtuoso version 07.20.3229 as of Jul 10 2020, on Linux (x86_64-pc-linux-gnu), Single-Server Edition (94 GB total memory)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2025 OpenLink Software