unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* guile-www patches
@ 2002-07-11 15:58 Clinton Ebadi
  0 siblings, 0 replies; only message in thread
From: Clinton Ebadi @ 2002-07-11 15:58 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 412 bytes --]

I have two patches for http.scm and cgi.scm. I changed make-shared-substring 
into substring because make-shared-substring is deprecated, fixed the use of 
bound? in cgi.scm (instead I have to optional values default to #f), and made 
cgi.scm use #:key instead of #&key.


-- 
http://unknownlamer.org
Facts do not cease to exist because they are ignored.
                -- Aldous Huxley
Flag Burner.

[-- Attachment #2: cgi_patch --]
[-- Type: text/x-diff, Size: 2613 bytes --]

--- cgi.scm.orig	Thu Jul 11 11:49:11 2002
+++ cgi.scm	Fri Jul  5 19:17:46 2002
@@ -52,7 +52,7 @@
 ;;   (cgi:upload name)
 ;;   (cgi:cookies name)
 ;;   (cgi:cookie name)
-;;   (cgi:make-cookie value #&key path domain expires secure)
+;;   (cgi:make-cookie value #:key path domain expires secure)
 
 ;;; Code:
 
@@ -124,7 +124,7 @@
 ;;     path associated with the cookie.
 ;; (cgi:cookies NAME)
 ;;     Fetch the first cookie value associated with NAME.
-;; (cgi:make-cookie NAME VALUE #&key path domain expires secure)
+;; (cgi:make-cookie NAME VALUE #:key path domain expires secure)
 ;;     Create a cookie suitable for inclusion into an HTTP response
 ;;     header. Recognize optional parameters path, doman, expires,
 ;;     (which should be strings) and secure (which is boolean).
@@ -173,17 +173,18 @@
     (and cookie-values (car cookie-values))))
 
 (define-public cgi:make-cookie
-  (lambda* (name value #&key path domain expires secure)
+  (lambda* (name value #:key (path #f) (domain #f) 
+		 (expires #f) (secure #f))
            (format #f "Set-Cookie: ~A=~A~A~A~A~A"
                    name value
-                   (if (bound? path)
+                   (if path
                        (format #f "; path=~A" path) "")
-                   (if (bound? domain)
+                   (if domain
                        (format #f "; domain=~A" domain) "")
-                   (if (bound? expires)
+                   (if expires
                        (format #f "; expires=~A" expires) "")
-                   (if (and (bound? secure) secure)
-                       "; secure" ""))))
+                   (if secure
+		     "; secure" ""))))
 
 
 \f
@@ -203,10 +204,11 @@
   ;; Values are URL-encoded, so url:decode must be called on each one.
   (define (get-name pair)
     (let ((p (string-index pair #\=)))
-      (and p (make-shared-substring pair 0 p))))
+      (and p (substring pair 0 p))))
   (define (get-value pair)
     (let ((p (string-index pair #\=)))
-      (and p (url:decode (make-shared-substring pair (+ p 1))))))
+      (and p (url:decode (substring pair (+ p 1))))))
+
   (for-each (lambda (pair)
 	      (let* ((name (get-name pair))
 		     (value (get-value pair))
@@ -376,8 +378,7 @@
              (str str))
     (let ((pos (string-rindex str ch)))
       (if pos
-	  (loop (cons (make-shared-substring str (+ 1 pos)) fields)
-		(make-shared-substring str 0 pos))
-	  (cons str fields)))))
+ 	  (loop (cons (substring str (+ 1 pos)) fields)
+ 		(substring str 0 pos))))))
 
 ;;; www/cgi.scm ends here

[-- Attachment #3: http_patch --]
[-- Type: text/x-diff, Size: 766 bytes --]

--- http.scm.orig	Thu Jul 11 11:49:28 2002
+++ http.scm	Sat Apr 27 20:03:55 2002
@@ -135,9 +135,9 @@
 (define (parse-status-line statline)
   (let* ((first (string-index statline #\space))
 	 (second (string-index statline #\space (1+ first))))
-    (list (make-shared-substring statline 0 first)
-	  (make-shared-substring statline (1+ first) second)
-	  (make-shared-substring statline (1+ second)))))
+     (list (substring statline 0 first)
+ 	  (substring statline (1+ first) second)
+ 	  (substring statline (1+ second)))))
 
 \f
 ;;; HTTP connection management functions.
@@ -317,6 +317,6 @@
 	   (set! end (1- end)))
     (if (< end st)
 	""
-	(make-shared-substring s st end))))
+	(substring s st end))))
 
 ;;; www/http.scm ends here

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-07-11 15:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-07-11 15:58 guile-www patches Clinton Ebadi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).