support.ss
(module support mzscheme

  (require
   (lib "string.ss" "srfi" "13"))
  
  (provide 
   boolean
   string-array)

  (define (boolean bool)
    (if (string=? bool "true") #t #f))

  (define (string-array arr)
    ;; This is rather inefficient.  Lucky Selenium is so slow!
    (reverse
     (map
      (lambda (chars)
        (list->string (reverse chars)))
      (car
       (string-fold
        (lambda (char state)
          (let ([lst (car state)]
                [quoted? (cdr state)])
            (if quoted?
                (cons (cons (cons char (car lst)) (cdr lst))
                      #f)
                (cond
                 [(char=? char #\,) (cons (cons null lst) #f)]
                 [(char=? char #\\) (cons lst #t)]
                 [else (cons (cons (cons char (car lst)) (cdr lst)) #f)]))))
        (cons (list null) #f)
        arr)))))
   
  )