/[clhp]/clhp/clhp.lisp
ViewVC logotype

Diff of /clhp/clhp.lisp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by aventimiglia, Wed Oct 1 14:32:45 2003 UTC revision 1.10 by aventimiglia, Fri Oct 3 02:40:39 2003 UTC
# Line 185  functions." Line 185  functions."
185             contents             contents
186             name)))             name)))
187    
 (defun list-to-a-list (list &optional a-list)  
   "Converts a list to an a-list, pairing odd and even elements. If an  
 odd number of elements are in LIST, the last element is returnes as  
 the second value.  
 ex: (LIST-TO-A-LIST '(a b c d) --> '((a b)(c d)) NIL  
 ex: (LIST-TO-A-LIST '(1 2 3 4 5) --> '((1 2)(3 4)) 5"  
   (cond  
    ((null list) (nreverse a-list))  
    ((= 1 (length list)) (values (nreverse a-list) (car list)))  
    (t (list-to-a-list (cddr list)  
                       (cons (list (car list) (cadr list))  
                             a-list)))))  
   
188  ;; This is a convenience function for MAKE-XML-ELEMENT  ;; This is a convenience function for MAKE-XML-ELEMENT
189  (defun tag (&rest args)  (defun tag (&rest args)
190    "Creates an XML-ELEMENT, where (CAR ARGS) fills the :NAME slot. If    "Creates an XML-ELEMENT, where (CAR ARGS) fills the :NAME slot. If
# Line 211  ex: (tag 'A 'HREF \"http://bogus.com/\" Line 198  ex: (tag 'A 'HREF \"http://bogus.com/\"
198            --> <IMG SRC=\"pic.png\"></IMG>"            --> <IMG SRC=\"pic.png\"></IMG>"
199    (multiple-value-bind    (multiple-value-bind
200        (att-list contents)        (att-list contents)
201        (list-to-a-list (cdr args))        (cgi::list-to-a-list (cdr args))
202      (make-xml-element :name (car args)      (make-xml-element :name (car args)
203                :attributes att-list                :attributes att-list
204                :contents contents)))                :contents contents)))

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

  ViewVC Help
Powered by ViewVC 1.1.5