Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Ternary conditional operator
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Ada=== The 2012 edition of [[Ada (programming language)|Ada]] has introduced conditional expressions (using {{code|if}} and {{code|case}}), as part of an enlarged set of expressions including quantified expressions and expression functions. The Rationale for Ada 2012<ref>{{cite web|title=Rationale for Ada 2012|url=http://www.ada-auth.org/standards/12rat/html/Rat12-2-1.html|publisher=ACAA|access-date=10 December 2015}}</ref> states motives for Ada not having had them before, as well as motives for now adding them, such as to support "contracts" (also new). <syntaxhighlight lang="ada"> Pay_per_Hour := (if Day = Sunday then 12.50 else 10.00); </syntaxhighlight> When the value of an ''if_expression'' is itself of Boolean type, then the {{code|else}} part may be omitted, the value being True. Multiple conditions may chained using {{code|elsif}}.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)