From ... From: Erik Naggum Subject: Re: I don't understand Lisp Date: 1998/09/24 Message-ID: <3115618937722449@naggum.no>#1/1 X-Deja-AN: 394318502 References: <35fb182d.86050524@news.newsguy.com> <3115018001706846@naggu m.no> <1998Sep18.123342.10768@srs.gov> <36063374.1EEF2B1C@bt-sys.spamblock.bt.co.uk> <3115371273457872@naggum.no> <3607F45F.B3199A6C@bt-sys.spamblock.bt.co.uk> <3115539566299174@naggum.no> <36093818.F32DDB3@bt-sys.spamblock.bt.co.uk> <3115568738543631@naggum.no> <86iuiec5c6.fsf@coulee.tdb.com> mail-copies-to: never Organization: Naggum Software; +47 8800 8879; http://www.naggum.no Newsgroups: comp.lang.lisp * Russell Senior | I have adapted Erik's code to a slightly different interface that I find | more useful. It takes only a single sequence element for a delimiter, | rather than the &rest arguments of Erik's function. Also, it provides a | switch to optionally aggregate adjacent delimiter instances. Also, it | returns the values as a list of subsequences, rather than a multi-value | return. that's pretty amusing -- the first few versions of this function did indeed take a list of delimiters and return a list of values. however, I have come to prefer multiple values to lists of values -- they are easier to deal with when binding the result to variables, and especially when just using the first value, which I found that I did quite often. I also prefer to use APPLY when I already have a sequence, and when I was only hacking out the first element of a delimited string, the list-as-argument model became cumbersome. I'd have implemented COLLAPSE with (delete "" substrings :test #'equal) before reversing the list, and certainly made it optional once you make the delimiters a list of its own. I agree that this flag is useful. #:Erik