64 lines
1.9 KiB
HTML
64 lines
1.9 KiB
HTML
|
<!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 <string> )</tt>
|
||
|
<tt> (yes-or-no-p)</tt>
|
||
|
<tt> (yes-or-no-p <string> )</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>> (y-or-n-p "Well? ")
|
||
|
Well? (Y or N) ok
|
||
|
Well? (Y or N) no
|
||
|
Well? (Y or N) y
|
||
|
T
|
||
|
|
||
|
> (yes-or-no-p "Answer in full:")
|
||
|
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>© Colin Allen & Maneesh Dhagat <BR>
|
||
|
March 2007 </I>
|
||
|
</ADDRESS>
|
||
|
</BODY>
|