Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!caen!sdd.hp.com!spool.mu.edu!munnari.oz.au!goanna!ok From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe) Newsgroups: comp.lang.scheme Subject: Re: Why memq vs memv vs member, etc.? Message-ID: <5816@goanna.cs.rmit.oz.au> Date: 18 May 91 09:24:51 GMT References: <1991May10.230057.15591@Think.COM> Organization: Comp Sci, RMIT, Melbourne, Australia Lines: 36 In article , chip@soi.UUCP (Chip Morris) writes: > >I guess the only problem with optimizing out the explicit passing of > >the eq argument is that Scheme doesn't prohibit user programs from > >redefining standard procedure names as Common Lisp does. > > Perhaps one must grudgingly admit an analysis advantage to Common > Lisp's otherwise distressingly assymetrical treatment of the function > position. Looking at CLtL2, section 5.3.1, all I can see that bears on this is the final paragraph: It is permissible to use DEFUN to redefine a function, to install a corrected version of an incorrect definition, for example. It is permissible to redefine a macro as a function. It is an error to attempt to redefine the name of a ***special form*** (see table 5-1) as a function. I have not been able to find the alleged prohibition in the indexed pages describing DEFUN, FLET, or LABELS. Given that MEMBER is not a special form, what section of CLtL2 prohibits redefinition? Also, the analysis advantage, if it does exist, would only apply to predefined function names. For user-defined functions, we have ;; Lisp Scheme DEFUN : SET! ; functions can be redefined :: FLET : LET ; or locally rebound :: LABELS : LETREC ; in _both_ languages. CL _does_ have a way for users to declare things that can't be changed, but because of CL's "two name-spaces" approach, DEFCONSTANT _can't_ be used to define non-redefinable functions. Those Scheme dialects having define-constant and/or define-integrable _do_ allow users to write function definitions which can be optimised in the way that we'd like a generic MEMBER to be optimised. -- There is no such thing as a balanced ecology; ecosystems are chaotic.