Subject: Re: I don't understand Lisp From: Erik Naggum <clerik@naggum.no> Date: 1998/09/23 Newsgroups: comp.lang.lisp Message-ID: <3115568738543631@naggum.no> * Donald Fisk <donald.fisk@bt-sys.spamblock.bt.co.uk> | I cannot find delimited-substrings in CLTL2. (CLtL2 is irrelevant. CLtL1 or ANSI CL are the reference documents.) | Is it something you wrote yourself? yes, but it's been dumped with my Allegro CL image for well over a year, so it is in every way indistinguishable from the other elements of this environment. | If so, it proves my point: that you have to extend Lisp to support the | string processing functionality built into Snobol. well, you prove half your point but you ignore that you prove more than half of my point at the same time, namely that programming in "Common Lisp" is not just about the standard. "extending Common Lisp" is a piece of cake -- it is far from trivial to extend Perl or C++ the same way, although what's in Perl today is a testament to what people asked Larry Wall to extend Perl to do, and C++ got is cancerous growth from Bjarne Stroustrup's openness to any stray comer's wish. in both cases, however, there's a market for all kinds of packages. clearly it is OK to "extend" other languages. _somebody_ wrote those packages and they weren't turned away. (in fact, a good argument against both languages is not _nobody_ gets turned away, except those who want clean design and correctness.) why is it not OK with Common Lisp? why does everything have to be in the ANSI Standard to be usable? give people a language they cannot adapt, and they adapt it, but give them a language supremely adaptable, and they cringe from _having_ to adapt it. I don't understand this. or is it that Perl and C++ are such butt-ugly languages that nobody feels intimidated by their grandness to feel they are not "worthy" of extending them, while such an intimidation effectively prevents most people from "extending" Common Lisp? | I am reliably informed that this sort of thing is less straightforward in | Perl, which makes one wonder "What is the point of Perl?" given that | Snobol already existed. to form a community of people who were left out of every other community, namely system administrators who usually couldn't program _anything_ and who were only interested in quick-and-dirty solutions that appeared to keep the system up and runnding and themselves busy. Snobol couldn't do that, and Common Lisp certainly cannot attract that crowd. | However,there are other languages out there that are, for certain types | of task (in this case, Snobol for string processing), better than Lisp. only because somebody else went to the trouble of defining them for you. I don't understand why this is such a big deal. Perl and C++ are _about_ people not getting what they want and going ahead to create it. now, Perl and C++ are living proof of what happens when you feel like creating a whole new language just to get a minute incremental benefits. Lisp isn't like that. as much as I dislike Scheme for giving me a bucket of sand and a furnace when I want a glass coffee mug, at least it embodies the attitude that building something yourself and then strive to reuse it is the right way to go. Common Lisp is the way it is for the same reason, only people didn't have the needs that Perl satisfies. I don't think this is a problem at all. if you have a problem to which Perl is the best solution, you have at least two problems. #:Erik ------- (defun delimited-substrings (string &rest delimiters) "Return as multiple values the substrings delimited by each delimiter." (loop with substrings = () for delimiter in delimiters for start = 0 then (+ end length) ;after last delimiter ends for end = (search delimiter string :start2 start) for length = (length delimiter) do (push (subseq string start end) substrings) until (null end) ;the string was exhausted finally (when end ;the delimiters were exhausted (push (subseq string (+ end length)) substrings)) (return (values-list (nreverse substrings))))) -- ATTENTION, all abducting aliens! you DON'T need to RETURN them!