Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!paperboy!hsdndev!husc6!soi!chip From: chip@soi.UUCP (Chip Morris) Newsgroups: comp.lang.scheme Subject: Re: Why memq vs memv vs member, etc.? Message-ID: Date: 13 May 91 13:58:04 GMT References: <1991May10.230057.15591@Think.COM> Organization: Software Options Inc., Cambridge, Mass. Lines: 22 barmar@think.com (Barry Margolin) writes: >.... This seems to be an area where Common Lisp does what >I'd expect Scheme to do; CL has a single MEMBER function with a :TEST >option, while Scheme has MEMQ, MEMV, and MEMBER. Why not (member > eq?) instead of (memq )? I agree with Mr. Margolin on the style and generality of his proposal. However, I just finished speeding up a large Common Lisp application in which using MEMQ was much faster than using MEMBER (with a :TEST of #'EQ) was quite significant. The overhead of the additional parameters, especially keyword parameters, was alone enough to make a difference. Interestingly, the MEMQ provided as an extension by the implementation (Lucid) ran at about the same speed as a naively programmed MEMQ. So the presence of a good compiler suggests keeping language constructs to a minimum, more a Scheme idea than a Common Lisp idea. -- Chip Morris, Senior Engineer Software Options, Inc., 22 Hilliard St., Cambridge MA 02138 (617) 497-5054 chip@soi.com