utils: Slightly streamline extract-symbols with match.
This commit is contained in:
parent
9eca7bf449
commit
5a27469dce
1 changed files with 4 additions and 5 deletions
|
@ -135,11 +135,10 @@
|
||||||
;;; Produces a list of symbols appearing in the quoted expression
|
;;; Produces a list of symbols appearing in the quoted expression
|
||||||
;;; passed in the first argument.
|
;;; passed in the first argument.
|
||||||
(define (extract-symbols form)
|
(define (extract-symbols form)
|
||||||
(cond
|
(match form
|
||||||
[(symbol? form)
|
[(? symbol?) (list form)]
|
||||||
(list form)]
|
[(? list?) (flatten (for/list ([x form])
|
||||||
[(list? form)
|
(extract-symbols x)))]
|
||||||
(flatten (for/list ([x form]) (extract-symbols x)))]
|
|
||||||
[else '()]))
|
[else '()]))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue