(module match-generics ;;© Idiomdrottning, 2021. BSD 1-clause license (define-generic) (import scheme (chicken base) (chicken syntax) (only brev-separate define-ir-syntax* match-define) matchable) (import-for-syntax (only brev-separate call-table* match-define) matchable) (define-for-syntax gentable (call-table*)) (define-ir-syntax* define-generic ((define-generic (name . pattern) . body) (cons 'match-define (gentable (strip-syntax name) (cons (cons name pattern) body))))))