Fundamentals of CS I (CS151 2001S) : Reference
[Current]
[Discussions]
[Glance]
[Honesty]
[Instructions]
[Links]
[News]
[Search]
[Syllabus]
Primary
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Quizzes]
[Readings]
[Reference]
Sets
[Blackboard]
[Scheme Report]
[SamR's Schedule]
[Rebelsky/Fall 2000]
[Walker/Fall2000]
[Stone/Spring2000]
Links
| Procedure | and |
|---|---|
| Parameters | b1 ... bn, n Boolean values |
| Purpose | Determines if all the values are true. |
| Produces | A truth value: true (#t)
if all the values are true;
false (#f) if any is false. |
| Preconditions | All the parameters are Boolean values (unverified). |
| Examples | > (and #t #t #t) #t > (and (< 1 2) (< 2 3)) #t > (and (odd? 1) (odd? 3) (odd? 5) (odd? 6)) #f > (and) #t |
| Procedure | and |
|---|---|
| Parameters | exp1 ... expn, n expressions |
| Purpose | Evaluates expressions one-by-one until it reaches the end or false. |
| Produces | The value of one of the expressions.
Returns false (#f) if any of the expressions
evaluates to false. Returns the value of the last expression
if all the expressions evaluate to
something other than false. |
| Preconditions | (None) |
| Postconditions | Evalutes each of the expressions up to (and including) the first one that returns false. If all of the expressions return a non-false value, evaluates all of the expressions. |
| Examples | > (and "hello" "goodbye") "goodbye" > (and (display "Blah") (newline) "goodbye") Blah "goodbye" > (and (display "Blah") #f (display "Blech")) Blah #f |
"..." (double quote) |
+ (plus) |
#\character (pound backslash) |
#\newline |
#\space |
; (semicolon)
* (times) |
abs |
and |
append |
boolean? |
car |
cdr |
char? |
char<? |
char<=? |
char=? |
char>=? |
char>? |
char-alphabetic? |
char-ci<? |
char-ci<=? |
char-ci=? |
char-ci>? |
char-ci>=? |
char->integer |
char-downcase |
char-lower-case? |
char-numeric? |
char-upper-case? |
char-upcase |
char-whitespace? |
complex? |
cons |
eq? |
equal? |
eqv? |
exact? |
exact->inexact |
exp |
expt |
inexact? |
integer? |
integer->char
length |
list |
list? |
list-ref |
null |
null? |
number? |
procedure?
rational? |
real? |
reverse
sqrt |
string? |
symbol?
[Current]
[Discussions]
[Glance]
[Honesty]
[Instructions]
[Links]
[News]
[Search]
[Syllabus]
Primary
[Examples]
[Exams]
[Handouts]
[Homework]
[Labs]
[Outlines]
[Quizzes]
[Readings]
[Reference]
Sets
[Blackboard]
[Scheme Report]
[SamR's Schedule]
[Rebelsky/Fall 2000]
[Walker/Fall2000]
[Stone/Spring2000]
Links
Disclaimer: I usually create these pages on the fly. This means that they are rarely proofread and may contain bad grammar and incorrect details. It also means that I may update them regularly (see the history for more details). Feel free to contact me with any suggestions for changes.
This page was generated by Siteweaver on Thu Feb 22 05:47:32 2001.
This page may be found at http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2001S/and.html.
You may validate
this page's HTML.
The source was last modified Wed Jan 31 22:29:25 2001.