What You've Learned

In this chapter, we discussed exotic types of lists and created a drawing library for mathematical graphs. Along the way, you learned the following:

  • You can create lists in Lisp that end in a value other than nil. Such lists are displayed with an extra dot before the last item and are called dotted lists.

  • Pairs are what you get when you cons together two items that are not lists themselves. They can also be thought of as dotted lists that contain only two items.

  • Circular lists are lists where the last cons cell points to an earlier cons cell in the same list.

  • Association lists (alists) are lists of pairs. They can be used to store data that is in the form of keys associated with values.

  • Lisp syntax expressions are great for storing and visualizing list-like and hierarchical data. Extra tools may be helpful for visualizing more complex data.

  • If your data is in the form of a mathematical graph, it’s helpful to be able to generate pictures of your data using Graphviz.

  • A common technique for generating textual data in a Lisp program is to write functions that print the text to the console for easy debugging and wrap these functions in thunks. Then you can send these thunks to other functions, which capture the console output and route the text to the appropriate destination, such as writing it to a file.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.70.247