diff --git a/1-04-02-consing.md b/1-04-02-consing.md index d07a93f42d28ba8b6c983d7ab0ffd81abbf0d31b..2e4f78f4a1828ee69bf745ca4094ea84b6f563e0 100644 --- a/1-04-02-consing.md +++ b/1-04-02-consing.md @@ -2,19 +2,32 @@ ## Consing -One way to create a Cons-Cell is using the `cons` function. +As we saw in the previous exercise, Cons-Cells can be created with the `cons` function. This operation is called *consing*. + +### In the REPL + +Let's try consing a few pairs of objects together. ```lisp -* (cons 'a 'b) -(A . B) +(cons 'a 'b) + +(cons 1 2) + +(cons "one" "two") ``` -They can hold any `type` of data, not just symbols. +### What You Should See + +The `cons` function returns a fresh Cons-Cell every time it is called. Since a Cons-Cell is just a pair of pointers it can combine any two Lisp objects into a pair, no matter what their type is. ```lisp +* (cons 'a 'b) +(A . B) + * (cons 1 2) (1 . 2) * (cons "one" "two") ("one" . "two") ``` +Notice the special syntax of the Cons-Cell returned at the REPL? This is called Dot-Notation and we'll learn more about it in the next exercise. diff --git a/CHANGELOG.md b/CHANGELOG.md index 5337b97f5ae1499ac6bf865fcc172b13bba7c1a5..421ddb7b14f63cc964939188f22eaae6953643f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,14 +1,20 @@ # CHANGELOG +## 2022-09-01 + +- Normalized use of tense in the CHANGELOG +- Chapter 1.4, "Lists and List Operations" + - Revised Exercise 1.4.2, restructuring into separate "In the REPL and What You Should See" subsections + ## 2022-08-31 -- Update README.md for the LLTHW source-control repository +- Updated README.md for the LLTHW source-control repository ## 2022-08-30 - Chapter 1.4, "Lists and List Operations" - Revised Exercise 1.4.1, restructuring into separate "In the REPL" and "What You Should See" subsections the way LxTHW books are supposed to be - - Split all exercises into separate documents and adjust Markdown formatting accordingly + - Split all exercises into separate documents and adjusted Markdown formatting accordingly - Renamed Exercise 1.4.10 from "Push and Pop" to "Stacks" - Renamed Exercise 1.4.11 from "Pop" to "PUSH and POP" - Update TODO list @@ -22,13 +28,13 @@ ## 2022-08-29 - Exercise 1.1.8, "Configuring Your Development Environment" - - Revise subsection on choice of text editors because my information was woefully out-of-date - - Minor clarifications to subsection on being comfortable at the command-line as I think exactly how to word it + - Revised subsection on choice of text editors because my information was woefully out-of-date + - Clarified subsection on being comfortable at the command-line as I think exactly how to word it ## 2022-08-26 -- Fix syntax highlighting for Exercise 1.5.12, "More Tries" -- Update callout blocks to use "hints" plugin: +- Fixed syntax highlighting for Exercise 1.5.12, "More Tries" +- Updated callout blocks to use "hints" plugin: - Exercise 1.2.3, "Unicode and Strings" - Exercise 1.2.5, "More Characters" - Exercise 1.2.6, "Character Codes" @@ -40,17 +46,17 @@ ## 2022-08-25 - Exercise 1.1.8, "Configuring Your Development Environment" - - Clean-up inline hints - - Remove deprecated section about the in-browser REPL - - Clarify download and installation instructions for SBCL and Quicklisp - - Rewrite and simplify section on choosing a text editor to avoid all talk + - Cleaned-up inline hints + - Removed deprecated section about the in-browser REPL + - Clarified download and installation instructions for SBCL and Quicklisp + - Rewrote and simplified section on choosing a text editor to avoid all talk of Emacs and Vim (like I should have done in the first place) ## 2022-08-24 -- Add book.json to manually define GitBook configuration and fix some outstanding oddities -- Reorganize SUMMARY.md to generate a better TOC for "folding-chapters" plugin -- Add GitBook plugins: +- Added book.json to manually define GitBook configuration and fix some outstanding oddities +- Reorganized SUMMARY.md to generate a better TOC for "folding-chapters" plugin +- Added GitBook plugins: - "hints" - "folding-chapters" - "localized-footer" @@ -58,8 +64,8 @@ ## 2022-08-23 -- Add CHANGELOG and TODO chapters -- Deprecate and remove old "Draft Progress at a Glance" section from title page +- Added CHANGELOG and TODO chapters +- Deprecated and removed old "Draft Progress at a Glance" section from title page ## 2022-08-22