# CP104 Lecture Notes - Lecture 5: Function Application, Boolean Expression, Boolean Function

**hayjayshay**and

**38575 others**unlocked

2

###### CP104 Full Course Notes

Verified Note

2 documents

## Document Summary

Boolean value is either true or false boolean function produces a boolean value. Comparison is a function that consumes two numbers and produces a boolean value (< x y) ex: (> 3 1) true. Mathematical statements combined by using and, or, not. Ex: 3 x < 7 (and (<= 3 x) (< x 7)) The arguments of and and or are evaluated in order from left to right. Boolean function that determines if data is of a particular form. Each argument of cond is a question/answer pair. The answer is a possible value of the conditional expression. Sometimes expressions should take different values under different conditions. Ex: |a| (cond [(< x 0) (- x)] [(> = x 0) x]) The questions are evaluated in order; as soon as one evaluates to true, the corresponding answer is evaluated and becomes the value of the whole expression no further questions are evaluated.