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
Guard (computer science)
(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!
== Terminology == The term is used with specific meaning in [[APL (programming language)|APL]], [[Haskell (programming language)|Haskell]], [[Clean programming language|Clean]], [[Erlang programming language|Erlang]], [[Occam (programming language)|occam]], [[Promela]], [[OCaml]], [[Swift (programming language)|Swift]],<ref>{{Cite web | url = http://nshipster.com/guard-and-defer/ | title = guard & defer | last = Cook | first = Nate | website = NSHipster | access-date = 2016-02-26 }}</ref> [[Python (programming language)|Python]] from version 3.10, and [[Scala (programming language)|Scala]] programming languages.{{Citation needed|date=March 2012}} In [[Mathematica]], guards are called ''constraints''. Guards are the fundamental concept in [[Guarded Command Language]], a language in [[formal methods]]. Guards can be used to augment [[pattern matching]] with the possibility to skip a pattern even if the structure matches. Boolean expressions in [[Conditional (programming)|conditional statement]]s usually also fit this definition of a guard although they are called ''conditions''.
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)