1
0
Fork 0
cl-sites/HyperSpec-7-0/HyperSpec/Body/17_bb.htm
2024-04-01 10:24:07 +02:00

46 lines
7.1 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: Section 17.2.2</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="17_baa.htm">
<LINK REL=UP HREF="17_b.htm">
<LINK REL=NEXT HREF="17_bba.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="17_baa.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Previous]" SRC="../Graphics/Prev.gif" ALIGN=Bottom></A><A REL=UP HREF="17_b.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Up]" SRC="../Graphics/Up.gif" ALIGN=Bottom></A><A REL=NEXT HREF="17_bba.htm"><IMG WIDTH=40 HEIGHT=40 ALT="[Next]" SRC="../Graphics/Next.gif" ALIGN=Bottom></A></H1>
<HR>
<H2>
17.2.2 Satisfying a One-Argument Test</H2> <P>
When using one of the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>functions</I></A> in the next figure, the elements E of a <A REL=DEFINITION HREF="26_glo_s.htm#sequence"><I>sequence</I></A> S are filtered not on the basis of the presence or absence of an object O under a two <A REL=DEFINITION HREF="26_glo_a.htm#argument"><I>argument</I></A> <A REL=DEFINITION HREF="26_glo_p.htm#predicate"><I>predicate</I></A>, as with the <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>functions</I></A> described in <A REL=CHILD HREF="17_ba.htm">Section 17.2.1 (Satisfying a Two-Argument Test)</A>, but rather on the basis of a one <A REL=DEFINITION HREF="26_glo_a.htm#argument"><I>argument</I></A> <A REL=DEFINITION HREF="26_glo_p.htm#predicate"><I>predicate</I></A>. <P>
<PRE>
<A REL=DEFINITION HREF="f_assocc.htm#assoc-if">assoc-if</A> <A REL=DEFINITION HREF="f_mem_m.htm#member-if">member-if</A> <A REL=DEFINITION HREF="f_rassoc.htm#rassoc-if">rassoc-if</A>
<A REL=DEFINITION HREF="f_assocc.htm#assoc-if-not">assoc-if-not</A> <A REL=DEFINITION HREF="f_mem_m.htm#member-if-not">member-if-not</A> <A REL=DEFINITION HREF="f_rassoc.htm#rassoc-if-not">rassoc-if-not</A>
<A REL=DEFINITION HREF="f_countc.htm#count-if">count-if</A> <A REL=DEFINITION HREF="f_substc.htm#nsubst-if">nsubst-if</A> <A REL=DEFINITION HREF="f_rm_rm.htm#remove-if">remove-if</A>
<A REL=DEFINITION HREF="f_countc.htm#count-if-not">count-if-not</A> <A REL=DEFINITION HREF="f_substc.htm#nsubst-if-not">nsubst-if-not</A> <A REL=DEFINITION HREF="f_rm_rm.htm#remove-if-not">remove-if-not</A>
<A REL=DEFINITION HREF="f_rm_rm.htm#delete-if">delete-if</A> <A REL=DEFINITION HREF="f_sbs_s.htm#nsubstitute-if">nsubstitute-if</A> <A REL=DEFINITION HREF="f_substc.htm#subst-if">subst-if</A>
<A REL=DEFINITION HREF="f_rm_rm.htm#delete-if-not">delete-if-not</A> <A REL=DEFINITION HREF="f_sbs_s.htm#nsubstitute-if-not">nsubstitute-if-not</A> <A REL=DEFINITION HREF="f_substc.htm#subst-if-not">subst-if-not</A>
<A REL=DEFINITION HREF="f_find_.htm#find-if">find-if</A> <A REL=DEFINITION HREF="f_pos_p.htm#position-if">position-if</A> <A REL=DEFINITION HREF="f_sbs_s.htm#substitute-if">substitute-if</A>
<A REL=DEFINITION HREF="f_find_.htm#find-if-not">find-if-not</A> <A REL=DEFINITION HREF="f_pos_p.htm#position-if-not">position-if-not</A> <A REL=DEFINITION HREF="f_sbs_s.htm#substitute-if-not">substitute-if-not</A>
</PRE>
<P><B>Figure 17-3. Operators that have One-Argument Tests to be Satisfied</B> <P>
The element Ei might not be considered directly. If a <TT>:key</TT> <A REL=DEFINITION HREF="26_glo_a.htm#argument"><I>argument</I></A> is provided, it is a <A REL=DEFINITION HREF="26_glo_d.htm#designator"><I>designator</I></A> for a <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> of one <A REL=DEFINITION HREF="26_glo_a.htm#argument"><I>argument</I></A> to be called with each Ei as an <A REL=DEFINITION HREF="26_glo_a.htm#argument"><I>argument</I></A>, and <I>yielding</I> an <A REL=DEFINITION HREF="26_glo_o.htm#object"><I>object</I></A> Zi to be used for comparison. (If there is no <TT>:key</TT> <A REL=DEFINITION HREF="26_glo_a.htm#argument"><I>argument</I></A>, Zi is Ei.) <P>
<A REL=DEFINITION HREF="26_glo_f.htm#function"><I>Functions</I></A> defined in this specification and having a name that ends in ``<TT>-if</TT>'' accept a first <A REL=DEFINITION HREF="26_glo_a.htm#argument"><I>argument</I></A> that is a <A REL=DEFINITION HREF="26_glo_d.htm#designator"><I>designator</I></A> for a <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> of one <A REL=DEFINITION HREF="26_glo_a.htm#argument"><I>argument</I></A>, Zi. An Ei is said to <A REL=DEFINITION HREF="26_glo_s.htm#satisfy_the_test"><I>satisfy the test</I></A> if this <TT>:test</TT> <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> returns a <A REL=DEFINITION HREF="26_glo_g.htm#generalized_boolean"><I>generalized boolean</I></A> representing <A REL=DEFINITION HREF="26_glo_t.htm#true"><I>true</I></A>. <P>
<A REL=DEFINITION HREF="26_glo_f.htm#function"><I>Functions</I></A> defined in this specification and having a name that ends in ``<TT>-if-not</TT>'' accept a first <A REL=DEFINITION HREF="26_glo_a.htm#argument"><I>argument</I></A> that is a <A REL=DEFINITION HREF="26_glo_d.htm#designator"><I>designator</I></A> for a <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> of one <A REL=DEFINITION HREF="26_glo_a.htm#argument"><I>argument</I></A>, Zi. An Ei is said to <A REL=DEFINITION HREF="26_glo_s.htm#satisfy_the_test"><I>satisfy the test</I></A> if this <TT>:test</TT> <A REL=DEFINITION HREF="26_glo_f.htm#function"><I>function</I></A> returns a <A REL=DEFINITION HREF="26_glo_g.htm#generalized_boolean"><I>generalized boolean</I></A> representing <A REL=DEFINITION HREF="26_glo_f.htm#false"><I>false</I></A>. <P>
<A REL=CHILD HREF="17_bba.htm"><H2>
17.2.2.1 Examples of Satisfying a One-Argument Test</H2></A><P><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>