guile-sources
[Top][All Lists]
Advanced

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

guile-www/cgi.scm


From: sig
Subject: guile-www/cgi.scm
Date: Wed, 13 Aug 2003 22:44:57 -0400
User-agent: Mutt/1.2.5.1i

Here's an update to guile-www/cgi.scm which makes it work with
guile 1.6 style keyword arguments. This is probably long overdue.


cya
.sig

--- cgi.scm.old 2003-08-13 21:18:10.000000000 -0500
+++ cgi.scm     2003-08-13 21:32:03.000000000 -0500
@@ -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).
@@ -172,18 +172,14 @@
   (let ((cookie-values (cgi:cookies name)))
     (and cookie-values (car cookie-values))))
 
-(define-public cgi:make-cookie
-  (lambda* (name value #&key path domain expires secure)
-           (format #f "Set-Cookie: ~A=~A~A~A~A~A"
-                   name value
-                   (if (bound? path)
-                       (format #f "; path=~A" path) "")
-                   (if (bound? domain)
-                       (format #f "; domain=~A" domain) "")
-                   (if (bound? expires)
-                       (format #f "; expires=~A" expires) "")
-                   (if (and (bound? secure) secure)
-                       "; secure" ""))))
+(define*-public (cgi:make-cookie name value #:key (path #f)
+                               (domain #f) (expires #f) (secure #f))
+  (format #f "Set-Cookie: ~A=~A~A~A~A~A"
+         name value
+         (if path (format #f "; path=~A" path) "")
+         (if domain (format #f "; domain=~A" domain) "")
+         (if expires (format #f "; expires=~A" expires) "")
+         (if secure "; secure" "")))
 
 
 




reply via email to

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