6.md
November 16, 2016 · View on GitHub
Part 6: working with lists
This is the last section before we're done implementing the language, and compared to the last part it should be relatively easy.
Any proper language needs good data structures, and lists are one of them. To be able to work properly with lists, we’ll introduce four new forms to our language:
consis used to construct lists from a "head" element, and the rest of the list (the "tail").headextracts the first element of a listtailreturns the rest of the elements, once the first is dropped.emptytakes a list as input, and returns#tif it is empty and#fotherwise.
Go on then, finish your language.
nosetests tests/test_6_working_with_lists.py --stop
What's next?
With the language implementation done, it's time to use our language in part 7.