UNB/ CS/ David Bremner/ teaching/ cs4613/ lectures/ lecture11/ evcase.rkt
#lang racket
(define-syntax evcase
  (syntax-rules ()
    [(_ key-expr) (error 'evcase "missing case")]
    [(_ key-expr [val body] clauses ...)
     (if (equal? key-expr val) body
         (evcase key-expr clauses ...))]))

(define (func x)
  (evcase 42
    [(+ x 2) #f]
    [(* 6 7) #t]))