174 lines
12 KiB
HTML
174 lines
12 KiB
HTML
<!-- Common Lisp HyperSpec (TM), version 7.0 generated by Kent M. Pitman on Mon, 11-Apr-2005 2:31am EDT -->
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>CLHS: Issue TEST-NOT-IF-NOT Writeup</TITLE>
|
|
<LINK HREF="../Data/clhs.css" REL="stylesheet" TYPE="text/css" />
|
|
<META HTTP-EQUIV="Author" CONTENT="Kent M. Pitman">
|
|
<META HTTP-EQUIV="Organization" CONTENT="LispWorks Ltd.">
|
|
<LINK REL=TOP HREF="../Front/index.htm">
|
|
<LINK REL=COPYRIGHT HREF="../Front/Help.htm#Legal">
|
|
<LINK REL=DISCLAIMER HREF="../Front/Help.htm#Disclaimer">
|
|
<LINK REL=PREV HREF="../Issues/iss344_w.htm">
|
|
<LINK REL=UP HREF="../Issues/iss345.htm">
|
|
<LINK REL=NEXT HREF="../Issues/iss346_w.htm">
|
|
</HEAD>
|
|
<BODY>
|
|
<H1><A REV=MADE HREF="http://www.lispworks.com/"><IMG WIDTH=80 HEIGHT=65 ALT="[LISPWORKS]" SRC="../Graphics/LWSmall.gif" ALIGN=Bottom></A><A REL=TOP HREF="../Front/index.htm"><IMG WIDTH=237 HEIGHT=65 ALT="[Common Lisp HyperSpec (TM)]" SRC="../Graphics/CLHS_Sm.gif" ALIGN=Bottom></A> <A REL=PREV HREF="../Issues/iss344_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="../Issues/iss345.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="../Issues/iss346_w.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
|
|
|
|
<HR>
|
|
|
|
|
|
|
|
<H2>Issue TEST-NOT-IF-NOT Writeup</H2>
|
|
|
|
<PRE><B>status:</B> Passed, as amended, Jan 89 X3J13<P>
|
|
Note: some confusion in minutes as to whether <A REL=DEFINITION HREF="../Body/f_comple.htm#complement"><B>COMPLEMENT</B></A> was added<P>
|
|
as part of <A HREF="iss345.htm">TEST-NOT-IF-NOT</A> or whether <A HREF="iss172.htm">FUNCTION-COMPOSITION</A> was<P>
|
|
passed but with only <A REL=DEFINITION HREF="../Body/f_comple.htm#complement"><B>COMPLEMENT</B></A> preserved.<P>
|
|
In any case: <A HREF="iss345.htm">TEST-NOT-IF-NOT:FLUSH-ALL</A> as stated here<P>
|
|
passed with "Remove" -> "Deprecate". See issue<P>
|
|
<A HREF="iss172.htm">FUNCTION-COMPOSITION</A> for more details.<P>
|
|
<P>
|
|
<B>Forum:</B> Cleanup<P>
|
|
<B>Issue:</B> <A HREF="iss345.htm">TEST-NOT-IF-NOT</A><P>
|
|
<B>References:</B> Functions offering a :TEST-NOT keyword:<P>
|
|
<A REL=DEFINITION HREF="../Body/f_adjoin.htm#adjoin"><B>ADJOIN</B></A> (p276), <A REL=DEFINITION HREF="../Body/f_assocc.htm#assoc"><B>ASSOC</B></A> (p280), <A REL=DEFINITION HREF="../Body/f_countc.htm#count"><B>COUNT</B></A> (p257), <A REL=DEFINITION HREF="../Body/f_rm_rm.htm#delete"><B>DELETE</B></A> (p254),<P>
|
|
<A REL=DEFINITION HREF="../Body/f_rm_dup.htm#delete-duplicates"><B>DELETE-DUPLICATES</B></A> (p254), <A REL=DEFINITION HREF="../Body/f_find_.htm#find"><B>FIND</B></A> (p257),<P>
|
|
<A REL=DEFINITION HREF="../Body/f_isec_.htm#intersection"><B>INTERSECTION</B></A> (p277), <A REL=DEFINITION HREF="../Body/a_member.htm#member"><B>MEMBER</B></A> (p275), <A REL=DEFINITION HREF="../Body/f_mismat.htm#mismatch"><B>MISMATCH</B></A> (p257),<P>
|
|
<A REL=DEFINITION HREF="../Body/f_isec_.htm#nintersection"><B>NINTERSECTION</B></A> (p277), <A REL=DEFINITION HREF="../Body/f_set_di.htm#nset-difference"><B>NSET-DIFFERENCE</B></A> (p278),<P>
|
|
<A REL=DEFINITION HREF="../Body/f_set_ex.htm#nset-exclusive-or"><B>NSET-EXCLUSIVE-OR</B></A> (p278), <A REL=DEFINITION HREF="../Body/f_sublis.htm#nsublis"><B>NSUBLIS</B></A> (p275), <A REL=DEFINITION HREF="../Body/f_substc.htm#nsubst"><B>NSUBST</B></A> (p274),<P>
|
|
<A REL=DEFINITION HREF="../Body/f_sbs_s.htm#nsubstitute"><B>NSUBSTITUTE</B></A> (p256), <A REL=DEFINITION HREF="../Body/f_unionc.htm#nunion"><B>NUNION</B></A> (p276), <A REL=DEFINITION HREF="../Body/f_pos_p.htm#position"><B>POSITION</B></A> (p257),<P>
|
|
<A REL=DEFINITION HREF="../Body/f_rassoc.htm#rassoc"><B>RASSOC</B></A> (p281), <A REL=DEFINITION HREF="../Body/f_rm_rm.htm#remove"><B>REMOVE</B></A> (p253), <A REL=DEFINITION HREF="../Body/f_rm_dup.htm#remove-duplicates"><B>REMOVE-DUPLICATES</B></A> (p254),<P>
|
|
<A REL=DEFINITION HREF="../Body/f_search.htm#search"><B>SEARCH</B></A> (p258), <A REL=DEFINITION HREF="../Body/f_set_di.htm#set-difference"><B>SET-DIFFERENCE</B></A> (p278), <P>
|
|
<A REL=DEFINITION HREF="../Body/f_set_ex.htm#set-exclusive-or"><B>SET-EXCLUSIVE-OR</B></A> (p278), <A REL=DEFINITION HREF="../Body/f_sublis.htm#sublis"><B>SUBLIS</B></A> (p274), <A REL=DEFINITION HREF="../Body/f_subset.htm#subsetp"><B>SUBSETP</B></A> (p279),<P>
|
|
<A REL=DEFINITION HREF="../Body/f_substc.htm#subst"><B>SUBST</B></A> (p273), <A REL=DEFINITION HREF="../Body/f_sbs_s.htm#substitute"><B>SUBSTITUTE</B></A> (p255), <A REL=DEFINITION HREF="../Body/f_tree_e.htm#tree-equal"><B>TREE-EQUAL</B></A> (p264),<P>
|
|
<A REL=DEFINITION HREF="../Body/f_unionc.htm#union"><B>UNION</B></A> (p276);<P>
|
|
Functions with "-IF-NOT" in their name:<P>
|
|
<A REL=DEFINITION HREF="../Body/f_assocc.htm#assoc-if-not"><B>ASSOC-IF-NOT</B></A> (p280), <A REL=DEFINITION HREF="../Body/f_countc.htm#count-if-not"><B>COUNT-IF-NOT</B></A> (p257),<P>
|
|
<A REL=DEFINITION HREF="../Body/f_rm_rm.htm#delete-if-not"><B>DELETE-IF-NOT</B></A> (p254), <A REL=DEFINITION HREF="../Body/f_find_.htm#find-if-not"><B>FIND-IF-NOT</B></A> (p257),<P>
|
|
<A REL=DEFINITION HREF="../Body/f_mem_m.htm#member-if-not"><B>MEMBER-IF-NOT</B></A> (p275), <A REL=DEFINITION HREF="../Body/f_substc.htm#nsubst-if-not"><B>NSUBST-IF-NOT</B></A> (p274),<P>
|
|
<A REL=DEFINITION HREF="../Body/f_sbs_s.htm#nsubstitute-if-not"><B>NSUBSTITUTE-IF-NOT</B></A> (p256), <A REL=DEFINITION HREF="../Body/f_pos_p.htm#position-if-not"><B>POSITION-IF-NOT</B></A> (p257),<P>
|
|
<A REL=DEFINITION HREF="../Body/f_rassoc.htm#rassoc-if-not"><B>RASSOC-IF-NOT</B></A> (p281), <A REL=DEFINITION HREF="../Body/f_rm_rm.htm#remove-if-not"><B>REMOVE-IF-NOT</B></A> (p253),<P>
|
|
<A REL=DEFINITION HREF="../Body/f_substc.htm#subst-if-not"><B>SUBST-IF-NOT</B></A> (p273), <A REL=DEFINITION HREF="../Body/f_sbs_s.htm#substitute-if-not"><B>SUBSTITUTE-IF-NOT</B></A> (p255);<P>
|
|
Related Issue: <A HREF="iss172.htm">FUNCTION-COMPOSITION</A><P>
|
|
<B>Category:</B> CHANGE<P>
|
|
<B>Edit history:</B> 02-Oct-88, Version 1 by Pitman (just FLUSH-ALL)<P>
|
|
05-Oct-88, Version 2 by Pitman (add option FLUSH-TEST-NOT)<P>
|
|
01-Dec-88, Version 3 by Masinter (add discussion)<P>
|
|
18-Mar-89, Version 4 by Masinter (as amended)<P>
|
|
<P>
|
|
<B>Problem Description:<P>
|
|
</B><P>
|
|
The -IF-NOT functions are functionally unnecessary.<P>
|
|
<P>
|
|
The :TEST-NOT keywords are not only functionally unnecessary but<P>
|
|
also problematic because it's not clear what to do when both :TEST<P>
|
|
and :TEST-NOT are provided.<P>
|
|
<P>
|
|
Many people think Common Lisp is more `bloated' than it needs<P>
|
|
to be and these aspects of the language are commonly cited<P>
|
|
specific examples.<P>
|
|
<P>
|
|
<B>Proposal (TEST-NOT-IF-NOT:FLUSH-ALL):<P>
|
|
</B><P>
|
|
Deprecate all -IF-NOT functions (named above) from Common Lisp.<P>
|
|
<P>
|
|
Deprecate the :TEST-NOT keyword from the Common Lisp functions which <P>
|
|
currently <A REL=DEFINITION HREF="../Body/f_provid.htm#provide"><B>provide</B></A> them (named above).<P>
|
|
<P>
|
|
<P>
|
|
Rationale:<P>
|
|
<P>
|
|
This makes the language a bit simpler.<P>
|
|
<P>
|
|
The removal of :TEST-NOT also makes the language easier to explain.<P>
|
|
<P>
|
|
Cost to Implementors:<P>
|
|
<P>
|
|
Very slight.<P>
|
|
<P>
|
|
Some symbols would disappear from the LISP package but could<P>
|
|
still be offered in proprietary packages if deemed important<P>
|
|
enough.<P>
|
|
<P>
|
|
Implementations could compatibly retain the :TEST-NOT keywords<P>
|
|
for an interim period.<P>
|
|
<P>
|
|
<B>Current Practice:<P>
|
|
</B><P>
|
|
Presumably no one has done this yet.<P>
|
|
<P>
|
|
<B>Cost to Users:<P>
|
|
</B><P>
|
|
Some rewrites would be needed.<P>
|
|
<P>
|
|
Those rewrites, which are already fairly simple, would be even<P>
|
|
more simple if some form of the <A HREF="iss172.htm">FUNCTION-COMPOSITION</A> issue is<P>
|
|
voted in -- in particular, the <A REL=DEFINITION HREF="../Body/f_comple.htm#complement"><B>COMPLEMENT</B></A> function which it <P>
|
|
proposes would help enormously in this regard.<P>
|
|
<P>
|
|
<B>Cost of Non-Adoption:<P>
|
|
</B><P>
|
|
Common Lisp would continue to be what some people feel is<P>
|
|
"bigger than it needs to be".<P>
|
|
<P>
|
|
<B>Benefits:<P>
|
|
</B><P>
|
|
The cost of non-adoption would be avoided.<P>
|
|
<P>
|
|
<B>Aesthetics:<P>
|
|
</B><P>
|
|
Presumably this makes the language easier to teach.<P>
|
|
<P>
|
|
<B>Performance impact:<P>
|
|
</B><P>
|
|
Very small; removing the :TEST-NOT keywords would<P>
|
|
make the simple implementation of the functions that<P>
|
|
used to have them slightly faster, but the resulting<P>
|
|
code of the inner loop is likely to be much slower.<P>
|
|
<P>
|
|
<B>Discussion:<P>
|
|
</B><P>
|
|
Many people objected strongly to this proposals --<P>
|
|
they might have been a nice idea five years ago, but are<P>
|
|
gratuitous incompatibilities now: incompatible changes with<P>
|
|
insufficient payback.<P>
|
|
<P>
|
|
Some of those objections might be tempered if some additional<P>
|
|
changes were made to Common Lisp: adding a <A REL=DEFINITION HREF="../Body/f_comple.htm#complement"><B>COMPLEMENT</B></A><P>
|
|
function, or if there were a strategy to declare some parts of the<P>
|
|
language "obsolete". Since these conditions haven't been done,<P>
|
|
their objections stand.<P>
|
|
<P>
|
|
Steele noted that one main reservation to FLUSH-ALL is that<P>
|
|
he uses <A REL=DEFINITION HREF="../Body/f_rm_rm.htm#remove-if-not"><B>REMOVE-IF-NOT</B></A> much more than <A REL=DEFINITION HREF="../Body/f_rm_rm.htm#remove-if"><B>REMOVE-IF</B></A>.<P>
|
|
<P>
|
|
This issue is related to <A HREF="iss172.htm">FUNCTION-COMPOSITION</A>, but is not<P>
|
|
dependent on it. Some support the combination of FLUSH-ALL and <P>
|
|
the NEW-FUNCTIONS part of <A HREF="iss172.htm">FUNCTION-COMPOSITION</A> in spite of<P>
|
|
the incompatible change because of the aesthetic appeal.<P>
|
|
<P>
|
|
Some people expressed their intention to vote for FLUSH-ALL<P>
|
|
only if FUNCTION-COMPOSITION:NEW-FUNCTIONS.<P>
|
|
<P>
|
|
It was noted that and<P>
|
|
adding a #~ readmacro such that <P>
|
|
(<A REL=DEFINITION HREF="../Body/f_find_.htm#find-if-not"><B>FIND-IF-NOT</B></A> #'<A REL=DEFINITION HREF="../Body/f_zerop.htm#zerop"><B>ZEROP</B></A> '(0 0 3))<P>
|
|
== (<A REL=DEFINITION HREF="../Body/f_find_.htm#find-if"><B>FIND-IF</B></A> (<A REL=DEFINITION HREF="../Body/f_comple.htm#complement"><B>COMPLEMENT</B></A> #'<A REL=DEFINITION HREF="../Body/f_zerop.htm#zerop"><B>ZEROP</B></A>) '(0 0 3))<P>
|
|
== (<A REL=DEFINITION HREF="../Body/f_find_.htm#find-if"><B>FIND-IF</B></A> #~ZEROP '(0 0 3))<P>
|
|
<P>
|
|
The modification of these functions is moot for those who<P>
|
|
prefer to use extended <A REL=DEFINITION HREF="../Body/m_loop.htm#loop"><B>LOOP</B></A> macro/iteration constructs<P>
|
|
in lieu of the sequence functions.<P>
|
|
<P>
|
|
Several alternative names for <A REL=DEFINITION HREF="../Body/f_rm_rm.htm#remove-if-not"><B>REMOVE-IF-NOT</B></A> were<P>
|
|
suggested: KEEP-IF, ABSTRACT, FILTER. We did not<P>
|
|
pursue these suggestions.<P>
|
|
</PRE>
|
|
<HR>
|
|
|
|
<A REL=NAVIGATOR HREF="../Front/StartPts.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Starting Points]" SRC="../Graphics/StartPts.gif" ALIGN=Bottom></A><A REL=TOC HREF="../Front/Contents.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Contents]" SRC="../Graphics/Contents.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Master.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Index]" SRC="../Graphics/Index.gif" ALIGN=Bottom></A><A REL=INDEX HREF="../Front/X_Symbol.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Symbols]" SRC="../Graphics/Symbols.gif" ALIGN=Bottom></A><A REL=GLOSSARY HREF="../Body/26_a.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Glossary]" SRC="../Graphics/Glossary.gif" ALIGN=Bottom></A><A HREF="../Front/X3J13Iss.htm"><IMG WIDTH=80 HEIGHT=40 ALT="[Issues]" SRC="../Graphics/Issues.gif" ALIGN=Bottom></A><BR>
|
|
|
|
<A REL=COPYRIGHT HREF="../Front/Help.htm#Legal"><I>Copyright 1996-2005, LispWorks Ltd. All rights reserved.</I></A><P>
|
|
</BODY>
|
|
</HTML>
|