You're introduced to:
- Defining functions
- Built in functions such as nth
- Naming things such as functions and values
- Lists
The exercises are to define a function that returns the second element in a list and at least a couple of implementations of a function that returns the third element in the list.
Here are my implementations of second:
And here are my implementations of third:
I've used the inbuilt functions nth, first, rest and done an implementation of third that uses one of my implementations of second.
No comments:
Post a Comment