Questions?

Let's discuss some of the homework. (I've posted my solutions.)

I've posted the next homework assignment, starting two new sections of the book (2.1, 1.3) and learning some new syntax .

First, a new (and more general way to create functions: `lambda`

(or `λ`

) .

Second, a way to define local variables : `let`

.

It turns out that you can define `let`

in terms of `lambda`

...
as explained in the text (and the example here) ... and which I've asked you to describe in the homework.

And finally, we want to start looking at data structures , not just numbers and strings.

The (awkwardly named) functions in scheme are : `car`

, `cons`

, `cdr`

, `list`

...
which it turns out we can combine in all sorts of ways. Some of which are more "standard"
in lisp than others.

We'll work through some examples in class.

Some other places to read about this stuff :

related: `null?`

, `'()`

, `pair?`

,

coming: `map`

, `filter`

, `accumulate`

, ...

possible class exercise :

- create a tree data structure
- write a function to count the number of elements in that tree
- write an API to create and access such a tree

... to continue working through the book & the exercises.

last modified | size | ||

fig2_3.png |
Wed Sep 15 2021 10:29 pm | 132K | |

lambda.png |
Wed Sep 15 2021 10:33 pm | 47K | |

let.png |
Wed Sep 15 2021 10:33 pm | 45K |