Path: g2news2.google.com!news3.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!193.201.147.78.MISMATCH!feeder.news-service.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: William Clifford Newsgroups: gnu.emacs.help,comp.emacs,comp.lang.lisp,comp.lang.python Subject: Re: Lisp refactoring puzzle Date: Wed, 13 Jul 2011 17:53:49 -0700 Organization: A noiseless patient Spider Lines: 32 Message-ID: <86oc0xn0ma.fsf@gsosw-lego-spare1.domain.actdsltmp> References: <19f8eb5b-cc90-472a-8399-4a5787b6fecf@glegroupsg2000goo.googlegroups.com> <2c59f63a-b46f-4ea9-bc12-da4841687117@l28g2000yqc.googlegroups.com> <5cb297e4-6a39-461c-98c5-639e72e166af@p10g2000prf.googlegroups.com> <87y603nwys.fsf@pangea.home.gustad.com> <983mh1Fs7cU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx04.eternal-september.org; posting-host="hbmMLmhO3cMJa2rMO0OCrQ"; logging-data="11064"; mail-complaints-to="ab...@eternal-september.org"; posting-account="U2FsdGVkX19VnvuiM0uCcq6srh21kkke" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:PBzLRliKDYNWOnmU8r98rhn4W14= sha1:ThZ5OFCJt1u0UasdnXCHvSKAvUw= Neil Cerutti writes: > On 2011-07-12, Petter Gustad wrote: >> Xah Lee writes: >> >>> it's funny, in all these supposedly modern high-level langs, they >>> don't provide even simple list manipulation functions such as union, >>> intersection, and the like. Not in perl, not in python, not in lisps. >> >> In Common Lisp you have: >> >> CL-USER> (union '(a b c) '(b c d)) >> (A B C D) >> CL-USER> (intersection '(a b c) '(b c d)) >> (C B) > > What's the rationale for providing them? Are the definitions > obvious for collections that a not sets? This seems like a good general question to me, although, I feel like the answer to this question specifically is "yes, obvious enough." A general purpose programming language ought to be general enough to allow expansion, but have enough "obvious" features, that one doesn't have to reinvent the wheel. I recently read somewhere that human languages "differ less in what they allow, and more in what they require" (paraphrase). I have little-to-no computer science expertise, but I sense that in computer languages with Turing equivalency this is exactly true. -- William Clifford