[Top][All Lists]

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

Re: Rationale for split-string?

From: Stephen J. Turnbull
Subject: Re: Rationale for split-string?
Date: Wed, 23 Apr 2003 13:09:23 +0900
User-agent: Gnus/5.090016 (Oort Gnus v0.16) XEmacs/21.5 (cabbage)

>>>>> "rms" == Richard Stallman <address@hidden> writes:

    (defun split-string (string &optional separators omit-nulls)

      "Splits STRING into substrings bounded by matches for SEPARATORS.

    The beginning and end of STRING, and each match for SEPARATORS, are
    splitting points.  The substrings between the splitting points are
    collected in a list, which is returned.  (The substrings matching
    SEPARATORS are removed.)

    If SEPARATORS is nil, it defaults to \"[ \f\t\n\r\v]+\".

    If OMIT-NULLs is t, zero-length substrings are omitted from the list
    (so that for the default value of SEPARATORS leading and trailing
    whitespace are trimmed).  If nil, all zero-length substrings are
    retained, which correctly parses CSV format, for example."

    rms> That seems like the right thing, except I think that if
    rms> SEPARATORS is nil, OMIT-NULLS should default to t.

OK.  That is satisfactory for XEmacs, and we'll implement that.

Unless you say you prefer to do it yourself, I will also submit a
patch against GNU Emacs CVS head, and audit the Lisp code in CVS head
to make sure there are no surprises from callers with non-default

Institute of Policy and Planning Sciences     http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
               Ask not how you can "do" free software business;
              ask what your business can "do for" free software.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]