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

substrings (sigh)

Having flamed against "start,count", I must admit that -- given 0-basing
-- "start,count" offers a solution I could live with.  Using Rees'
proposed nomenclature:

  (STRING-SLICE string m n)  take n characters of (m to end)
  (STRING-SLICE string m -n) drop n characters from (m to end)

To get all but the last character, (STRING-SLICE string 0 -1).  Seems
simple, concise, and consistent to me.

SUBSTRING-FROM-END doesn't do the job of getting all but the last N
characters than SUBSTRING.  All it does is move the STRING-LENGTH
calculation from the End-point to the Start-point.  Conceptually, I
want to say "Get a substring; start at the beginning, end at the
second-last character."  The choice of anchor-points is separate from
the action of slicing.

I think Drew's modest proposal would confuse the masses to please the
few (e.g., me).

So -- could people live with negative counts?