emacs.d/clones/colinallen.dnsalias.org/lp/node115.html

64 lines
1.9 KiB
HTML
Raw Normal View History

2022-08-02 12:34:59 +02:00
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
<!Originally converted to HTML using LaTeX2HTML 95 (Thu Jan 19 1995) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
<HEAD>
<TITLE> y-or-n-p, yes-or-no-p (PREDICATES)</TITLE>
</HEAD>
<BODY>
<meta name="description" value=" y-or-n-p, yes-or-no-p (PREDICATES)">
<meta name="keywords" value="lp">
<meta name="resource-type" value="document">
<meta name="distribution" value="global">
<P>
<BR> <HR>
<A HREF="node116.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A>
<A HREF="node72.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A>
<A HREF="node114.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <BR>
<A HREF="lp.html"><B>Contents</B></A>
<B> Next:</B>
<A HREF="node116.html"> About this document </A>
<B>Up:</B>
<A HREF="node72.html"> Appendix: Selected Lisp </A>
<B> Previous:</B>
<A HREF="node114.html"> symbolp (PREDICATE)</A>
<BR> <HR> <P>
<H1> y-or-n-p, yes-or-no-p (PREDICATES)</H1>
<P>
<b> Format:</b>
<tt> (y-or-n-p)</tt>
<tt> (y-or-n-p &lt;string&gt; )</tt>
<tt> (yes-or-no-p)</tt>
<tt> (yes-or-no-p &lt;string&gt; )</tt>
<P>
<b> Required arguments:</b>
none
<P>
<b> Optional arguments:</b> 1
<P>
Optional argument must evaluate to a string
<P>
The user is prompted with the string text (if provided). y-or-n-p returns t if y or Y is entered or nil if n or N is entered, but reprompts the user if given any other response. yes-or-no-p behaves similarly but requires a yes or no respsonse (upper or lower case mixed is ok).
<P>
<b> Examples:</b>
<P>
<BLOCKQUOTE>
<PRE>&gt; (y-or-n-p &quot;Well? &quot;)
Well? (Y or N) ok
Well? (Y or N) no
Well? (Y or N) y
T
&gt; (yes-or-no-p &quot;Answer in full:&quot;)
Answer in full: (Yes or No) y
Answer in full: (Yes or No) n
Answer in full: (Yes or No) nO
NIL
</PRE>
</BLOCKQUOTE>
<BR> <HR>
<P>
<ADDRESS>
<I>&#169; Colin Allen &amp; Maneesh Dhagat <BR>
March 2007 </I>
</ADDRESS>
</BODY>