Tokenize a string with character delimiters.
(strtok x delimiters) splits the string
As an example:
(strtok "foo bar, baz!" (list #\Space #\, #\!)) --> ("foo" "bar" "baz")
Note that all of the characters in
Function:
(defun strtok$inline (x delimiters) (declare (xargs :guard (and (stringp x) (character-listp delimiters)))) (let ((rtokens (strtok-aux x 0 (mbe :logic (len (explode x)) :exec (length x)) delimiters nil nil))) (mbe :logic (rev rtokens) :exec (reverse rtokens))))
Theorem:
(defthm string-listp-of-strtok (string-listp (strtok x delimiters)))
Theorem:
(defthm streqv-implies-equal-strtok-1 (implies (streqv x x-equiv) (equal (strtok x delimiters) (strtok x-equiv delimiters))) :rule-classes (:congruence))