CMPU 101 Lecture Notes - Lecture 6: Lazy Evaluation, Decision-Making

23 views2 pages

Document Summary

If special form: when special form, cond special form. X): when returns null if cond (bool?) Is false: you can have multiple expressions inside a when body, but you can"t in an if body, for cond special form, only 1 return expression is ever evaluated, once a boolexp returns true, nothing below is evaluated. If: the true part or false part is evaluated, but never both. When: the body is not evaluated if condition is false. Cond: only 1 clause is fully evaluated (only 1 condition returns #t and only 1 return value is executed) And: the boolean expressions that are its arguments are evaluated only until 1 evaluates to #f. Or: evaluates only until it finds #t (and boolexp1, boolexp2, . ,boolexpn: only evaluates until one boolexp returns #f. If none are false, returns #t (or boolexp1 boolexp2 boolexpn: only evaluates boolexpr"s until 1 returns #t. If none of boolexp are #t, it returns #f.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents