Add "annotations" procedure
This commit is contained in:
parent
669d1b480d
commit
4ed8fd2c92
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
(provide (struct-out annotated)
|
(provide (struct-out annotated)
|
||||||
annotate
|
annotate
|
||||||
|
annotations
|
||||||
strip-annotations
|
strip-annotations
|
||||||
strip-annotations-proc
|
strip-annotations-proc
|
||||||
peel-annotations
|
peel-annotations
|
||||||
|
@ -37,6 +38,11 @@
|
||||||
[item
|
[item
|
||||||
(annotated as #f item)]))
|
(annotated as #f item)]))
|
||||||
|
|
||||||
|
(define (annotations v)
|
||||||
|
(match v
|
||||||
|
[(annotated annotations _ _) annotations]
|
||||||
|
[_ '()]))
|
||||||
|
|
||||||
(define (strip-annotations-proc v #:depth [depth +inf.0])
|
(define (strip-annotations-proc v #:depth [depth +inf.0])
|
||||||
(let walk* ((v v) (depth depth))
|
(let walk* ((v v) (depth depth))
|
||||||
(define next-depth (- depth 1))
|
(define next-depth (- depth 1))
|
||||||
|
|
Loading…
Reference in New Issue