▼ |  | Unstable

1 | Guidelines for developing unstable libraries
2 | Bytes
3 | Contracts
4 | Exceptions
5 | Lists
6 | Net
7 | Path
8 | Source Locations
9 | Strings
10 | Structs
11 | Syntax
12 | Anaphoric Contracts
13 | Finding Mutated Variables
14 | Find
15 | Interface-Oriented Programming for Classes
16 | Sequences
17 | Hash Tables
18 | Match
19 | Skip Lists
20 | Interval Maps
21 | GUI libraries

On this page:

==

top← prev up next →

### 18`` Match

Sam Tobin-Hochstadt <samth@ccs.neu.edu>

(require unstable/match)

This library is unstable; compatibility will not be maintained. See Unstable for more information.

(== val comparator)
(== val)

A match expander which checks if the matched value is the same as val when compared by comparator. If comparator is not provided, it defaults to equal?.

Examples:

> (match (list 1 2 3)
[(== (list 1 2 3)) 'yes]
[_ 'no])

yes

> (match (list 1 2 3)
[(== (list 1 2 3) eq?) 'yes]
[_ 'no])

no

> (match (list 1 2 3)
[(list 1 2 (== 3 =)) 'yes]
[_ 'no])

yes

top← prev up next →