Ignore:
Timestamp:
02/07/09 22:31:57 (11 years ago)
Author:
sjamaan
Message:

Add absolute/relative uri/reference predicates and tests for them. Fix bug in absolute-uri and add tests for absolute uri

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/4/uri-generic/trunk/uri-generic.scm

    r13108 r13209  
    4747   authority-username authority-password
    4848   
    49    absolute-uri uri->string uri->list
    50    uri-relative-to uri-relative-from
     49   absolute-uri absolute-uri? uri->string uri->list
     50   relative-ref? uri-relative-to uri-relative-from
    5151   uri-decode-string uri-encode-string
    5252   uri-normalize-case uri-normalize-path-segments
     
    684684                             fragment: (and uf (uri-char-list->string uf))))))
    685685
     686(define (relative-ref? u)
     687  (and (uri? u) (not (uri-scheme u))))
     688
    686689(define (relative-part s)
    687690  (match s
     
    707710                                  path: (uri-path-list->path up) query: (and uq (uri-char-list->string uq))
    708711                                  fragment: #f)))
    709            (error 'absolute-uri "no scheme found in URI string"))))
    710 
     712           (else (error 'absolute-uri "no scheme found in URI string")))))
     713
     714(define (absolute-uri? u)
     715  (and (uri? u) (not (relative-ref? u)) (not (uri-fragment u))))
    711716
    712717;; Turns a URI into a string.
Note: See TracChangeset for help on using the changeset viewer.