From 5a27469dcec566980f65a083bf85b69828cb514b Mon Sep 17 00:00:00 2001 From: Sergiu Ivanov Date: Sun, 23 Feb 2020 09:00:54 +0100 Subject: [PATCH] utils: Slightly streamline extract-symbols with match. --- utils.rkt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/utils.rkt b/utils.rkt index 7dc9ca9..59f717d 100644 --- a/utils.rkt +++ b/utils.rkt @@ -135,11 +135,10 @@ ;;; Produces a list of symbols appearing in the quoted expression ;;; passed in the first argument. (define (extract-symbols form) - (cond - [(symbol? form) - (list form)] - [(list? form) - (flatten (for/list ([x form]) (extract-symbols x)))] + (match form + [(? symbol?) (list form)] + [(? list?) (flatten (for/list ([x form]) + (extract-symbols x)))] [else '()]))