Playing with a Rating Description

left top right

(define (get-categories name-value-list)
  ;; name-value-list is ((name . value) ...)
  ;; Returns a list of all of the (name . value) pairs where the name
  ;; is "category"
  (define (loop found rest)
    (if (null? rest)
        found
        (loop (if (eq? 'category (car (car rest)))
                  (cons (car rest) found)
                  found)
              (cdr rest))))
  (loop '() name-value-list))

(define (category.transmit-name category)
  ;; All categories have a transmit-name, according to the spec!
  (cadr (assq 'transmit-as (cdr category))))


(define (all-category-names description)
  (map car (->category-alist description)))

Jim Miller

http://www.w3.org/ W3C