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
Conditional (computer programming)
(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!
===Guarded conditionals=== The [[Guarded Command Language]] (GCL) of [[Edsger W. Dijkstra|Edsger Dijkstra]] supports conditional execution as a list of commands consisting of a Boolean-valued [[Guard (computer science)|guard]] (corresponding to a ''condition'') and its corresponding statement. In GCL, exactly one of the statements whose guards is true is evaluated, but which one is arbitrary. In this code '''if''' G0 β S0 β‘ G1 β S1 ... β‘ Gn β Sn '''fi''' the G<sub>''i''</sub>'s are the guards and the S<sub>''i''</sub>'s are the statements. If none of the guards is true, the program's behavior is undefined. GCL is intended primarily for reasoning about programs, but similar notations have been implemented in [[Concurrent Pascal]] and [[Occam (programming language)|occam]].
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)