r8587: add uri query function
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 1 Feb 2004 12:21:41 +0000 (12:21 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 1 Feb 2004 12:21:41 +0000 (12:21 +0000)
package.lisp
web-utils.lisp

index 62bf63791a82721db851bae6df08948c3dabbd7a..8e2e516e84e1f72f83bb8d81dc60f6189368daf6 100644 (file)
    #:*standard-xml-header*
    #:user-agent-ie-p
    #:decode-uri-query-string
+   #:split-uri-query-string
    
    ;; From xml-utils
    #:sgml-header-stream
index 35611eb0b9739bdd5c0c4b28d376ee84e0f1e008..40cb04018bed71dfd1883a0c09880261a7eda2f3 100644 (file)
             (t
              (setf (schar new p-new) c)
              (incf p-old))))))
+
+(defun split-uri-query-string (s)
+  (mapcar
+   (lambda (pair)
+     (let ((pos (position #\= pair)))
+       (when pos
+        (cons (subseq pair 0 pos)
+              (when (> (length pair) pos)
+                (decode-uri-query-string (subseq pair (1+ pos))))))))
+   (delimited-string-to-list s #\&)))