Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
3 Cards in this Set
- Front
- Back
PARSING |
By “parenthesizing everything” Racket has a syntax that is unambiguous. There are never any rules to learn about whether 1+2*3 is 1+(2*3) or (1+2)*3 and whether f x y is (f x) y or f (x y). It makes parsing, converting the program text into a tree representing the program structure. |
|
CONS CELL |
Cons cells are immutable: When you create a cons cell, its two fields are initialized and will never change. Hence we can continue to enjoy the benefits of knowing that cons cells cannot be mutated by other code in our program. It has another somewhat subtle advantage: The Racket implementation can be clever enough to make list? a constant-time operation since it can store with every cons cell whether or not it is a proper list when the cons cell is created. |
|
IMPROPER LIST |
A cons cell that is not a list is often called an improper list, especially if it has nested cons cells in the second position, e.g., (cons 1 (cons 2 (cons 3 4))) where the result prints as ’(1 2 3 . 4). |