Arc Cross Reference

tokens

[procedure] tokens s (o sep whitec)

(def tokens (s (o sep whitec))
  (let test (if (isa sep 'fn) sep (fn (c) (is c sep)))
    (let rec (afn (cs toks tok)
               (if (no cs)         (consif tok toks)
                   (test (car cs)) (self (cdr cs) (consif tok toks) nil)
                                   (self (cdr cs) toks (cons (car cs) tok))))
    (rev (map [coerce _ 'string]
              (map rev (rec (coerce s 'cons) nil nil)))))))