rework of gmi:match-link procedure
This commit is contained in:
16
gmi.rkt
16
gmi.rkt
@@ -156,16 +156,6 @@
|
|||||||
(document-items document)))
|
(document-items document)))
|
||||||
|
|
||||||
(define (match-link document id)
|
(define (match-link document id)
|
||||||
(define (iter next-structure)
|
(let ([link (findf (λ (link) (= (link-id link) id))
|
||||||
(cond
|
(filter link? (document-items document)))])
|
||||||
[(and (link? (car next-structure))
|
(if link (link-url link) #f)))
|
||||||
(= (link-id (car next-structure)) id))
|
|
||||||
(link-url (car next-structure))]
|
|
||||||
|
|
||||||
[(empty? (cdr next-structure))
|
|
||||||
#f]
|
|
||||||
|
|
||||||
[else
|
|
||||||
(iter (cdr next-structure))]))
|
|
||||||
|
|
||||||
(iter (document-items document)))
|
|
||||||
|
Reference in New Issue
Block a user