Today is our first Tutorial day! In the pre-recorded lecture, we explore the idea of abstraction: of making our code flexible rather than fixed.

The idea of compound functions is essentially a function within another function. Put more simply, it’s the idea that we can define our OWN functions. We do this through something called a lambda expression. Just as we can use (define netid "abc1234") to store the value of "abc1234" inside the name netid, we can store the value of a function inside a name like so:

(define add-1
  (lambda (x) (+ x 1)))

This means we can then call this function with inputs later on:

(add-1 1)

and Racket will look up the value of add-1 in its dictionary and then execute it with the input 1…eventually giving us 2!

Pretty cool.

In-class we’ll complete Tutorial 1 which is mostly focused on the content from Monday’s lecture on 2D Graphics, but the last activity of which requires you to define your own glasses function.


Today's Resources

1. Exercise Files

Download Exercise Files

2. Slides

3. Pre-Recorded Lecture Video(s), Mini-Quizzes, and Live Recordings

Available Videos
Link Title Type Duration
Video 0 Lecture 3.1 - Rules of Computation pre-recorded 7:42
Video 1 Lecture 3.2 - Defining New Names pre-recorded 7:42
Video 2 Lecture 3.3 - Abstracting pre-recorded 5:27
Video 3 Lecture 3.4 - Lambda Expressions (very important) pre-recorded 8:42
Video 4 Lecture 3.5 - Type Signatures

(MQ - No Longer Available)

video_quiz 5:37
Video 5 Lecture 3.6 - DrRacket Demos pre-recorded 5:53