guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (net http) 0.1


From: thi
Subject: Re: (net http) 0.1
Date: Sat, 31 Mar 2001 00:28:48 -0800

   From: Evan Prodromou <address@hidden>
   Date: 26 Mar 2001 01:26:36 -0800

   Located here:

           http://evan.prodromou.san-francisco.ca.us/net-http-0.1.tar.gz

   Your comments appreciated.

browsing the code, i see:

   ;; XXX: These are all too similar -- need to do some refactoring.
   ;; XXX: also, those list-ref calls are gross.
   
   ;;; Return an <http-response> with the headers for the given URI.
   
   (define (http-head uri)
     (let* ((parts (parse-uri uri))
            (request (make <http-request>
                       #:method "HEAD"
                       #:server (list-ref parts 1)
                       #:port (list-ref parts 2) #:uri (list-ref parts 3)
                       #:headers (list (cons "User-Agent" "(net http)/0.1")
                                       (cons "Host" (list-ref parts 1)))))
            (response (send-request request)))
       (close (get-content response))
       response))

you might investigate writing / finding a `destructuring-bind' macro.
let me know if you do, because i'd like to use it, too.

[cc redirected to guile-user.]

thi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]