About: Elvis operator     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : yago:PsychologicalFeature100023100, within Data Space : dbpedia.org associated with source document(s)
QRcode icon
http://dbpedia.org/describe/?url=http%3A%2F%2Fdbpedia.org%2Fresource%2FElvis_operator

In certain computer programming languages, the Elvis operator, often written ?:, is a binary operator that returns its first operand if that operand evaluates to a true value, and otherwise evaluates and returns its second operand. This is identical to a short-circuit or with "last value" semantics. The notation of the Elvis operator was inspired by the ternary conditional operator, ? : since the Elvis operator expression A ?: B is approximately equivalent to the ternary conditional A ? A : B.

AttributesValues
rdf:type
rdfs:label
  • Elvis operator (en)
  • エルビス演算子 (ja)
  • 埃尔维斯运算符 (zh)
rdfs:comment
  • エルビス演算子 (英語: elvis operator) は、いくつかのプログラミング言語にある演算子で、字句構文は ?: である。三項条件演算子 (? :) と違い、この連続する2文字で1つの演算子であり、意味的には三項演算子の第二項 (<i>A</i> ? <i>B</i> : <i>C</i>の<i>B</i>) が無いもの、というような機能を持っている。 Null合体演算子に似た制御機能を持つが、第一項の扱いが異なる。ただし、エルビス演算子にNull合体演算子の意味と役割を持たせている言語もある。 (ja)
  • 编程语言中,埃尔维斯运算符是一种二元运算符,常写为?:、or、||,如果第一操作数求值为真则返回其值,否则返回第二操作数的值。类似于带有“最后值”语义的短路求值。埃尔维斯运算符是受三元条件运算符 ? :启发而被提出的。因为埃尔维斯运算符表达式A ?: B近似于三元条件运算符A ? A : B。 埃尔维斯运算符得名于它的通常表示法?:,相似于埃尔维斯·普雷斯利(即“猫王”)的颜文字侧脸的,或者其他角度看相遇于他的得意的笑脸。 有一个相似的运算符是空值结合运算符,把布尔真值检查改为是否为空指针null。常写为??,如C#。 (zh)
  • In certain computer programming languages, the Elvis operator, often written ?:, is a binary operator that returns its first operand if that operand evaluates to a true value, and otherwise evaluates and returns its second operand. This is identical to a short-circuit or with "last value" semantics. The notation of the Elvis operator was inspired by the ternary conditional operator, ? : since the Elvis operator expression A ?: B is approximately equivalent to the ternary conditional A ? A : B. (en)
dcterms:subject
Wikipage page ID
Wikipage revision ID
Link from a Wikipage to another Wikipage
sameAs
dbp:wikiPageUsesTemplate
has abstract
  • In certain computer programming languages, the Elvis operator, often written ?:, is a binary operator that returns its first operand if that operand evaluates to a true value, and otherwise evaluates and returns its second operand. This is identical to a short-circuit or with "last value" semantics. The notation of the Elvis operator was inspired by the ternary conditional operator, ? : since the Elvis operator expression A ?: B is approximately equivalent to the ternary conditional A ? A : B. The name "Elvis operator" refers to the fact that when its common notation, ?:, is viewed sideways, it resembles an emoticon of Elvis Presley with his signature hairstyle. A similar operator is the null coalescing operator, where the boolean truth check is replaced with a check for non-null instead. This is usually written ??, and can be seen in languages like C#. (en)
  • エルビス演算子 (英語: elvis operator) は、いくつかのプログラミング言語にある演算子で、字句構文は ?: である。三項条件演算子 (? :) と違い、この連続する2文字で1つの演算子であり、意味的には三項演算子の第二項 (<i>A</i> ? <i>B</i> : <i>C</i>の<i>B</i>) が無いもの、というような機能を持っている。 Null合体演算子に似た制御機能を持つが、第一項の扱いが異なる。ただし、エルビス演算子にNull合体演算子の意味と役割を持たせている言語もある。 (ja)
  • 编程语言中,埃尔维斯运算符是一种二元运算符,常写为?:、or、||,如果第一操作数求值为真则返回其值,否则返回第二操作数的值。类似于带有“最后值”语义的短路求值。埃尔维斯运算符是受三元条件运算符 ? :启发而被提出的。因为埃尔维斯运算符表达式A ?: B近似于三元条件运算符A ? A : B。 埃尔维斯运算符得名于它的通常表示法?:,相似于埃尔维斯·普雷斯利(即“猫王”)的颜文字侧脸的,或者其他角度看相遇于他的得意的笑脸。 有一个相似的运算符是空值结合运算符,把布尔真值检查改为是否为空指针null。常写为??,如C#。 (zh)
prov:wasDerivedFrom
page length (characters) of wiki page
foaf:isPrimaryTopicOf
is Link from a Wikipage to another Wikipage of
is Wikipage disambiguates of
is foaf:primaryTopic of
Faceted Search & Find service v1.17_git139 as of Feb 29 2024


Alternative Linked Data Documents: ODE     Content Formats:   [cxml] [csv]     RDF   [text] [turtle] [ld+json] [rdf+json] [rdf+xml]     ODATA   [atom+xml] [odata+json]     Microdata   [microdata+json] [html]    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 08.03.3330 as of Mar 19 2024, on Linux (x86_64-generic-linux-glibc212), Single-Server Edition (378 GB total memory, 57 GB memory in use)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2024 OpenLink Software