Anatomy of a simple function in Racket
Channel: Nic McPhee
Date: 2023-08-28

Here I go over the basic structure of a function definition in Racket, including the encompassing `define` statement, the name and parameters, and the body. I then go over several examples, both in slides and in DrRacket.

I biffed a bit of terminology in this video. When people attempt to be consistent about such things, we use the term "parameter" for the named "input" in the function definition, and "argument" for the _value_ that is supplied in a call to a function. For example, n is a _parameter_ in this definition:

(define (double n) 
   (+ n n))

and the value 7 is the _argument_ in this call:

(double 7)

As a result what I call "name-and-arguments" in this video really ought to be "name-and-parameters". Oops. I noticed it late and didn't have time to go back and remake everything, so that mistake is just going to be there for now. In your head, please replace "name-and-arguments" with "name-and-parameters", though.

Sorry about that.