Subject: Re: How to split a string (or arbitrary sequence) at each occurrence of a value.
From: Erik Naggum <erik@naggum.net>
Date: Sat, 13 Oct 2001 17:02:24 GMT
Newsgroups: comp.lang.lisp
Message-ID: <3211981343483341@naggum.net>

* Christophe Rhodes
| A quick google gets me 
| 
| <URL:http://groups.google.com/groups?q=group:comp.lang.lisp+partition+split-sequence&hl=en&rnum=3&selm=y6clmm3lajm.fsf%40octagon.mrl.nyu.edu>
| 
| for instance; there's a thread of 35 articles, according to google.

  No, this is not discussing the transition from "split" _to_ "partition".
  Specifically, no articles even attempts to explain how "partition" was
  chosen and why it is a good name.  The overwhelmingly negative response
  to that name when you _did_ publish it was just ignored, as you admit.  I
  wonder how you can complain about people not raising their concerns when
  you just walked away when they did.

| Since I sincerely doubt (though do disabuse me if this isn't true) that
| any vendor has yet adopted partition, the cost to the community, wherever
| it resides, in changing the specification to the extent of the name
| ([...]) is minimal[*]. Given this, it's not a problem.

  It is and remains a problem if it is not _actually_ done.

* Erik Naggum
| As I have indicated, I think splitting strings and creating huge amounts
| of garbage during parsing is bad software design.  The incessant copying
| of characters that plague most parsers is _the_ source of bad performance.

* Christophe Rhodes
| And this is another matter entirely.

  Well, some of us think that if people ask for tail recursion, they should
  be told about other iteration constructs.  It is downright sad that as
  Common Lisp is such a great language for its ability to maintain identity
  of objects and therefore was inherently "object-oriented" before anyone
  invented that term, has succumbed to the very primitive properties to C
  and Unix tools where copying characters around all the time is _not_ seen
  as pretty damn stupid, which it is.  Strings are fairly expensive objects
  in Common Lisp -- they actually are in any language -- but copying text
  is a more expensive operation in Common Lisp than in languages that do it
  so often they have super-optimized copying functions.  This is even more
  true when the Common Lisp system uses Unicode internally and talks to a
  world that still uses 7- or 8-bit-encoded character sets.

| Nevertheless, given the frequency of requests in this forum for "a string
| splitting function" it might be useful to have something that was
| designed rather than 5 ad-hoc security-flawed answers for each occasion.

  Giving people what they want when they express their desire in the form
  of an implementation of a solution they could not write on their own is
  never going to help them.  People who ask such questions need to be told
  that they have to present their problem and not the solution they have
  chosen in their _ignorance_ of the solution space.

  But from where did "security-flawed" enter the picture?  I sense another
  matter entirely.  :)

///
-- 
  The United Nations before and after the leadership of Kofi Annan are two
  very different organizations.  The "before" United Nations did not deserve
  much credit and certainly not a Nobel peace prize.  The "after" United
  Nations equally certainly does.  I applaud the Nobel committee's choice.