;;; ;;; ;;; Poker-hands demonstration ;;; ;;; ;; ;; Matcher definitions ;; (define $suit (algebraic-data-matcher { })) (define $card (algebraic-data-matcher {})) ;; ;; A function that determins poker-hands ;; (define $poker-hands (lambda [$cs] (match cs (multiset card) {[ >>>>> ] [ >>>>> ] [ >>>>> ] [ >>>>> ] [ >>>>> ] [ >>>>> ] [ >>>>> ] [ >>>>> ] [>>>>> ]}))) ;; ;; Demonstration code ;; (test (poker-hands { 12> 10> 13> 1> 11>})) (test (poker-hands { 1> 2> 1> 1> 2>})) (test (poker-hands { 4> 2> 5> 1> 3>})) (test (poker-hands { 4> 10> 5> 1> 3>}))