whoops, these doc strings were already in arc.arc, these were misplaced

(doclist
  tokens
  " Splits `s' into tokens using `sep' (a character or predicate) as separator.
    Splits on contiguous runs of `sep's - no empty tokens are returned:

        arc> (tokens \"foo  bar\" whitec)
        (\"foo\" \"bar\")

    See also [[slices]] [[positions]] [[halve]] "

  slices
  " Splits `s' into slices using `sep' (a character or predicate) as separator.
    Splits on each occurrence of `sep' - a run of `sep's produces empty slices:

        arc> (slices \"foo  bar\" whitec)
        (\"foo\" \"\" \"bar\")

    See also [[tokens]] [[positions]] [[halve]] "

  halve
  " Splits `s' on the first instance of `sep' (a character or predicate).

    In more detail: Returns a list whose car is `s' up to the first occurrence
    of `sep', or all of `s' if `sep' never appears, and whose cadr (if `sep'
    appears) is the rest of `s' (including the leading `sep').

    See also [[tokens]] [[cut]] [[pos]] "

  positions
  " Lists all indices in `seq' which pass `test'. "

  lines
  " Splits `s' into a list of lines (not including line-terminators).
    See also [[tokens]] [[positions]] "

  urldecode
  " Decodes the string `s' as per application/x-www-form-urlencoded.
    See also [[urlencode]] "

  urlencode
  " Encodes the string `s' as per application/x-www-form-urlencoded.
    See also [[urldecode]] "

  litmatch
  " Test if `seq' starting at offset `start' begins with `pat'. Because of the
    macro expansion, `pat' must be a literal.
    See also [[endmatch]] [[headmatch]] [[begins]] "

  endmatch
  " Test if `seq' ends with `pat'. Because of the macro expansion, `pat' must be
    a literal.
    See also [[litmatch]] "

  posmatch
  " Return the index (from `start') where `pat' appears in `seq'. If `pat' is a
    predicate, it is applied to the characters of `seq' until it returns true.
    See also [[findsubseq]] [[pos]] "

  headmatch
  " Tests if `seq' from offset `start' onwards starts with `pat'. `headmatch'
    will die if `pat' is longer than `seq' and matches up to the end of `seq'.
    See also [[begins]] [[litmatch]] "

  begins
  " Tests if `seq' begins with `pat'. Equivalent to `(headmatch pat seq start)',
    except it doesn't die if matching goes past the end of `seq'.
    See also [[headmatch]] [[litmatch]] "

  subst
  " Substitutes `new' for `old' in `seq'. `new' can be any printable object.
    See also [[multisubst]] "

  multisubst
  " For each pair in `pairs', substitutes its cadr for its car in `seq'.
    See also [[subst]] "

  findsubseq
  " Finds the index where `pat' appears in `seq', starting at `start'.
    As `posmatch', but doesn't accept a function for `pat'.
    See also [[posmatch]] "

  blank
  " Tests if `str' is blank (entirely whitespace).
    See also [[nonblank]] [[whitec]] "

  nonblank
  " Returns nil if `s' is blank, and `s' otherwise.
    See also [[blank]] "

  trim
  " Trims character which pass `test' from `str'. `where' can be 'front, to trim
    the front of the string, 'back, to trim the end; or 'both, to trim both. "

  num
  " Formats a real number. `digits' is the number of digits after the decimal
    point, `trail-zeroes' indicates whether trailing zeros should be included,
    and `init-zero' indicates whether there should be a zero before the
    decimal point (if `(< -1 n 1)'). "

  pluralize
  " Returns `str' pluralized. If `n' is 1 or a list of length 1, `str' is
    returned unchanged; otherwise an `s' is appended.
    See also [[plural]] "

  plural
  " Returns a string \"<n> <x>\" representing `n' of `x' in english, pluralizing
    `x' if necessary.
    See also [[pluralize]] "
  )

(doclist
  tokens
  " Splits `s' into tokens using `sep' (a character or predicate) as separator.
    Splits on contiguous runs of `sep's - no empty tokens are returned:

        arc> (tokens \"foo  bar\" whitec)
        (\"foo\" \"bar\")

    See also [[slices]] [[positions]] [[halve]] "

  slices
  " Splits `s' into slices using `sep' (a character or predicate) as separator.
    Splits on each occurrence of `sep' - a run of `sep's produces empty slices:

        arc> (slices \"foo  bar\" whitec)
        (\"foo\" \"\" \"bar\")

    See also [[tokens]] [[positions]] [[halve]] "

  halve
  " Splits `s' on the first instance of `sep' (a character or predicate).

    In more detail: Returns a list whose car is `s' up to the first occurrence
    of `sep', or all of `s' if `sep' never appears, and whose cadr (if `sep'
    appears) is the rest of `s' (including the leading `sep').

    See also [[tokens]] [[cut]] [[pos]] "

  positions
  " Lists all indices in `seq' which pass `test'. "

  lines
  " Splits `s' into a list of lines (not including line-terminators).
    See also [[tokens]] [[positions]] "

  urldecode
  " Decodes the string `s' as per application/x-www-form-urlencoded.
    See also [[urlencode]] "

  urlencode
  " Encodes the string `s' as per application/x-www-form-urlencoded.
    See also [[urldecode]] "

  litmatch
  " Test if `seq' starting at offset `start' begins with `pat'. Because of the
    macro expansion, `pat' must be a literal.
    See also [[endmatch]] [[headmatch]] [[begins]] "

  endmatch
  " Test if `seq' ends with `pat'. Because of the macro expansion, `pat' must be
    a literal.
    See also [[litmatch]] "

  posmatch
  " Return the index (from `start') where `pat' appears in `seq'. If `pat' is a
    predicate, it is applied to the characters of `seq' until it returns true.
    See also [[findsubseq]] [[pos]] "

  headmatch
  " Tests if `seq' from offset `start' onwards starts with `pat'. `headmatch'
    will die if `pat' is longer than `seq' and matches up to the end of `seq'.
    See also [[begins]] [[litmatch]] "

  begins
  " Tests if `seq' begins with `pat'. Equivalent to `(headmatch pat seq start)',
    except it doesn't die if matching goes past the end of `seq'.
    See also [[headmatch]] [[litmatch]] "

  subst
  " Substitutes `new' for `old' in `seq'. `new' can be any printable object.
    See also [[multisubst]] "

  multisubst
  " For each pair in `pairs', substitutes its cadr for its car in `seq'.
    See also [[subst]] "

  findsubseq
  " Finds the index where `pat' appears in `seq', starting at `start'.
    As `posmatch', but doesn't accept a function for `pat'.
    See also [[posmatch]] "

  blank
  " Tests if `str' is blank (entirely whitespace).
    See also [[nonblank]] [[whitec]] "

  nonblank
  " Returns nil if `s' is blank, and `s' otherwise.
    See also [[blank]] "

  trim
  " Trims character which pass `test' from `str'. `where' can be 'front, to trim
    the front of the string, 'back, to trim the end; or 'both, to trim both. "

  num
  " Formats a real number. `digits' is the number of digits after the decimal
    point, `trail-zeroes' indicates whether trailing zeros should be included,
    and `init-zero' indicates whether there should be a zero before the
    decimal point (if `(< -1 n 1)'). "

  pluralize
  " Returns `str' pluralized. If `n' is 1 or a list of length 1, `str' is
    returned unchanged; otherwise an `s' is appended.
    See also [[plural]] "

  plural
  " Returns a string \"<n> <x>\" representing `n' of `x' in english, pluralizing
    `x' if necessary.
    See also [[pluralize]] "

  butlast
  " Returns a list containing every element of `x' but the last.
    See also: [[cut]] "

  between
  " As 'each, but runs `within' between each iteration of `body'.
    See also [[each]] "
  )


remove test that doesn't make sense anymore

(suite lists
       (suite cons
              create (assert-same '(a b c)
                                  (cons 'a '(b c)))
              cons-strings (assert-same '("a" . "b")
                                        (cons "a" "b")))
       (suite car
              car-of-nil-is-nil (assert-nil (car nil))
              car-of-empty-list-is-nil (assert-nil (car '()))
              empty-list-can-be-not-quoted (assert-nil (car ()))
              car-returns-car (assert-same 'foo
                                           (car '(foo 12.34 "bar"))))
       (suite cdr
              cdr-of-nil-is-nil (assert-nil (cdr nil))
              cdr-of-empty-list-is-nil (assert-nil (cdr '()))
              cdr-returns-cdr (assert-same '(12.34 "bar")
                                           (cdr '(foo 12.34 "bar"))))
       (suite scar
              on-lists (assert-same '(99 2 3)
                                    (ret lst '(1 2 3)
                                         (scar lst 99)))
              on-strings (assert-same "boo"
                                      (ret str "foo"
                                           (scar str #\b))))
       (suite scdr
              on-lists (assert-same '(a y z)
                                    (ret lst '(a b c)
                                         (scdr lst '(y z))))
              on-nested-list (assert-same '(a b c x y z)
                                          (ret lst '(a b c)
                                               (scdr (cdr (cdr lst))
                                                     '(x y z)))))

       size (assert-same 7
                         (len '(a b c d e f g)))
       set-element (assert-same '(x b c)
                                (ret lst '(a b c)
                                     (sref lst 'x 0)))
       get-element (assert-same 'c
                                ('(a b c d) 2)))

(suite lists
       (suite cons
              create (assert-same '(a b c)
                                  (cons 'a '(b c)))
              cons-strings (assert-same '("a" . "b")
                                        (cons "a" "b")))
       (suite car
              car-of-nil-is-nil (assert-nil (car nil))
              car-of-empty-list-is-nil (assert-nil (car '()))
              empty-list-can-be-not-quoted (assert-nil (car ()))
              car-returns-car (assert-same 'foo
                                           (car '(foo 12.34 "bar"))))
       (suite cdr
              cdr-of-nil-is-nil (assert-nil (cdr nil))
              cdr-of-empty-list-is-nil (assert-nil (cdr '()))
              cdr-returns-cdr (assert-same '(12.34 "bar")
                                           (cdr '(foo 12.34 "bar")))
              cdr-of-empty-list-returns-nil (assert-nil ((fn stuff
                                                             ((fn (outer)
                                                                  (((fn (self)
                                                                        (assign self
                                                                                (fn (inner)
                                                                                (if (is (type inner) 'cons)
                                                                                ((fn ()
                                                                                ((fn (x)
                                                                                (disp x))
                                                                                (car inner))
                                                                                (self (cdr inner))))) )))
                                                                    nil)
                                                                   outer))
                                                              stuff)))))
       (suite scar
              on-lists (assert-same '(99 2 3)
                                    (ret lst '(1 2 3)
                                         (scar lst 99)))
              on-strings (assert-same "boo"
                                      (ret str "foo"
                                           (scar str #\b))))
       (suite scdr
              on-lists (assert-same '(a y z)
                                    (ret lst '(a b c)
                                         (scdr lst '(y z))))
              on-nested-list (assert-same '(a b c x y z)
                                          (ret lst '(a b c)
                                               (scdr (cdr (cdr lst))
                                                     '(x y z)))))

       size (assert-same 7
                         (len '(a b c d e f g)))
       set-element (assert-same '(x b c)
                                (ret lst '(a b c)
                                     (sref lst 'x 0)))
       get-element (assert-same 'c
                                ('(a b c d) 2)))