v6.0-exception
Matthew Butterick 6 years ago
parent 1b3712dc8e
commit a3b407e59c

@ -22,8 +22,12 @@
(define+provide+safe (txexpr? x [short-only #f])
predicate/c
(match x
[(list (? txexpr-tag?) (? my-xexpr?) ...) #true]
[(list (? txexpr-tag?) (? txexpr-attrs?) (? my-xexpr?) ...) #:when (not short-only) #true]
[(cons (? txexpr-tag?) rest)
(=> resume)
(match rest
[(list (? my-xexpr?) ...) #true]
[(list (? txexpr-attrs?) (? my-xexpr?) ...) #:when (not short-only) #true]
[_ (resume)])]
[_ #false]))
(define+provide+safe (txexpr-short? x)

Loading…
Cancel
Save