Switch
Evaluates the value paired with the first form the expression matches.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram Language
Switch✓Switch(expr, form1, val1, form2, val2, ...)The first whose (evaluated) (evaluated) equals; a bare (Blank) as a always matches, as a default case. Stays unevaluated if nothing matches.Typed signatures
| Type | Package | Applies |
|---|---|---|
(any, any*) -> any | combinatorics | always |
Details
- Matching is structural equality only, not Wolfram's fuller pattern language — a form is either a literal value or the bare wildcard .
Examples
About
| Examples | 2 |
|---|---|
| Checked against | Wolfram Language 1 agree1 unevaluated |
| Crosswalk | Wolfram Language |
See also: Do