On this page:
==

20 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