diff --git a/txexpr/base.rkt b/txexpr/base.rkt index 267c08e..fd2559c 100644 --- a/txexpr/base.rkt +++ b/txexpr/base.rkt @@ -261,7 +261,7 @@ x)))) ;; function to split tag out of txexpr -(define+provide+safe deleted-signal symbol? (gensym)) +(define deleted-signal #f) (define+provide+safe (splitf-txexpr tx pred [proc (λ (x) deleted-signal)]) ((txexpr? procedure?) (procedure?) . ->* . (values txexpr? txexpr-elements?)) (unless (txexpr? tx) diff --git a/txexpr/scribblings/txexpr.scrbl b/txexpr/scribblings/txexpr.scrbl index f02cf33..5a1f62c 100644 --- a/txexpr/scribblings/txexpr.scrbl +++ b/txexpr/scribblings/txexpr.scrbl @@ -469,18 +469,12 @@ In practice, most @racket[_txexpr-element]s are strings. But it's unwise to pass ] -@deftogether[( - -@defthing[deleted-signal symbol?] - @defproc[ (splitf-txexpr [tx txexpr?] [pred procedure?] -[replace-proc procedure? (λ (x) deleted-signal)]) +[replace-proc procedure? (λ (x) #f)]) (values txexpr? (listof txexpr-element?))] - -)] Recursively descend through @racket[_txexpr] and extract all elements that match @racket[_pred]. Returns two values: a @racket[_txexpr] with the matching elements removed, and the list of matching elements. Sort of esoteric, but I've needed it more than once, so here it is. @examples[#:eval my-eval @@ -489,7 +483,7 @@ Recursively descend through @racket[_txexpr] and extract all elements that match (splitf-txexpr tx is-meta?) ] -Ordinarily, the result of the split operation is to remove the elements that match @racket[_pred]. This happens only when returning @racket[_deleted-signal]. You can change this behavior with the optional @racket[_replace-proc] argument. +Ordinarily, the result of the split operation is to remove the elements that match @racket[_pred]. But you can change this behavior with the optional @racket[_replace-proc] argument. @examples[#:eval my-eval (define tx '(div "Wonderful day" (meta "weather" "good") "for a walk"))