Smatchcube's website 🌍


Exercise 2.66

Here is my solution:

As an example to how we can use this procedure, let’s represent records as a pair of a key and a name.

Now for example if we call (lookup 4 records) we get (4 . "Lucas") as intended. If no records have the desired key the returned value is #f (false). We could easily implement procedures to return only the name of a record from a given key, the possibilities are endless with this convenient representation.