[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PVS-Help] pvs-utils.el and elib

It seems like pvs-utils defines a version of string-split that has an
interface and implementation that is inconsistent with the elib function
of the same name.  This seems unfortunate.  Is there any chance one
could rename the pvs-utils function as pvs-string-split or something

This is the elib definition:
(defun string-split (pattern string &optional limit)
  "Splitting on regexp PATTERN, turn string STRING into a list of
Optional third arg LIMIT (>= 1) is a limit to the length of the
resulting list."

  (let ((data (match-data)))
        (let* ((start (string-match pattern string))
               (result (list (substring string 0 start)))
               (count 1)
               (end (if start (match-end 0))))
          (if end                       ; else nothing left
              (while (and (or (not (integerp limit))
                              (< count limit))
                          (string-match pattern string end))
                (setq start (match-beginning 0)
                      count (1+ count)
                      result (cons (substring string end start) result)
                      end (match-end 0)
                      start end)))
          (if (and (or (not (integerp limit))
                       (< count limit))
                   end)                 ; else nothing left
              (setq result
                    (cons (substring string end) result)))
          (nreverse result))
      (store-match-data data))))

[oh for a package system!]

Would it be appropriate for me to report this as a bug?


Robert P. Goldman
Senior Scientist
Smart Information Flow Technologies (d/b/a SIFT, LLC)

211 N. First St., Suite 300
Minneapolis, MN 55401

Voice:	(612) 384-3454
Email:    rpgoldman@SIFT.info