1.7 KiB
1.7 KiB
Hints
1. Making a new list
- Common Lisp has a rather descriptively named function for making a LIST.
2. Add things to the list.
- To add something to the beginning of a list it is idiomatic to CONStruct a new list with the item as the
car
and the list as thecdr
. In the Hyperspec can be found a page that describes this function.
3. What's next thing(s) on the list?
- Common Lisp has a general purpose function to get an item from any index of a list.
- It also has several helpers for accessing indexes under 11
- List indexes are zero based.
4. Removing a thing from the list
- An idiomatic way to remove the first item of a list is to use a function which can separate the
cdr
of the list from thecar
of the list. In the Hyperspec one can find a page describing one of the functions to do this.
5. Bigger lists out of smaller lists
- Common Lisp has a function specifically for adding one list to front of another
6. How much longer?
- Common Lisp has an obviously named function to get the length of a list.