Skip to main content

Class 17: Boolean Values and Predicate Procedures

Held: Monday, 20 February 2017

We consider a new type

Preliminaries

Overview

  • Boolean values
  • True vs. truish
  • Predicates - procedures that return Boolean values
  • Combining Boolean values with and and or

Updates

News / Etc.

  • New partners!
  • I plan to return exam 1 this evening. I will also distribute some notes on the exam and an updated set of grades.
  • I will hold class on March 1. I will not penalize you from missing provided you send me a short summary of what you did during class time.
    • “Sam, I spent class time contemplating the best approach to making our nation strong again.”
    • “Sam, I spent class time listening to a speaker suggesting ways to make our nation inclusive.”

Rotating reminders

  • Use our tutors! We have tutors available Sunday through Thursday evening from 7-10 p.m. in Science 3813/15.

Upcoming Work

Extra credit (Academic/Artistic)

  • CS Table, Tuesday at noon, 21 Feb 2017. Net neutrality. Reading packets should be available outside Curtsinger’s office or Orsera’s office.
  • NEW Women in CS, Tuesday, 21 February 2017: Applying for GHC Scholarships and more! (All are welcome to attend.)
  • Thursday extras, Thursday, 23 Feb 2017, 4:15 p.m., Science 3821: The Future of MathLAN
  • Met Opera Live in HD showing of Rusalka, Saturday, Feb. 25. Talk 11:30-noon, opera noon-3pmish.
  • Prazak Quartet, Tuesday, 28 February 2017, 7:30 p.m., Herrick.

Extra credit (Peer)

Good things to do

  • Grinnell Equestrian Club Drill Team bake sale, 20 February 2017, 11am-2pm and 4pm-9pm.

The joy of trig.

  • Remember SOHCAHTOA!
  • For a circle, you can find the x and y coordinates of any point around the edge of the circle by …
  • For an ellipse, we use a very similar formula.
  • Details in eboard

Preparation

  • What did you learn from the reading? (Let’s try to summarize for each other.)
  • What questions do you have?

or and and as control structures

  • How does normal procedure application work?
    • Evaluate all the parameters
    • “Plug them in to the body”
    • Evaluate the body
  • How does or work?
    • It evaluates each parameter, in turn, until one holds (or it runs out of parameters).
    • As soon as one holds, it stops and returns that value.
  • How does and work?
    • It evaluates each parameter, in turn, until one fails to hold (or it runs out of parameters).
    • As soon as one fails to hold, it stops and returns #f.
  • This evaluation strategy means that we can use and and or to evaluate a sequence of expressions, stopping when we get the first acceptable one.

Lab

  • Work on the lab
  • Be prepared to discuss!