6.001 Structure and Interpretation of Computer Programs. Copyright o 2004 by Massachusetts Institute of Technology Slide 8.1.14 Symbol: printed representation Something different happens with quotes. If we type in an xpression involving the special name quote, the evaluator [quote beta) r)(*xx}} checks the type of this expression, recognizes the special form #[compound-.1 beta and uses a rule designed for such special expressions In the case of quote, we simply take the second subexpression and create an internal representation for it. The reader symbol ecognizes this as a sequence of characters and creates a symbol with that sequence of characters, like a name. The evaluator then returns to the visible world something to print out, simply he name that we just quoted, beta in this case Slide 8.1.15 object, note that we can use it anywhere we would expect to use(ist1, e ordinary values Now that we have the ability to create this new kind of data =>(12) such primitive objects. For example, we can certainly create a list of normal things, like numbers. Remember that creating the list of I and 2 returns a printed representation of that list structure, written as (1 2) 601h Symbols are ordinary values Slide 8.1.16 but I could also create a list of quoted things we evaluate the 1st12) arguments to list, getting two symbols, then create the list of (list (quote delta) (quote gamma) 【de1 ta garma) those symbols, finishing with a printed representation of the structure created by gluing those symbols together 6 001 SICP Slide 8.1.17 Symbols are ordinary values What does that list look like? Well. list creates a box-and- =>(12) pointer structure just as in the case of numbers Thus at the top mist (quote detal (u (dez ra bomma)) level of that structure. we will have a skeleton containing two things, ending in the special"empty list"symbol. And what hangs off of this spine? a pointer to the data structure of a symbol! Thus we can use symbols in the same places we might have earlier used numbers within other data structures de1七a ganna 6001S6.001 Structure and Interpretation of Computer Programs. Copyright © 2004 by Massachusetts Institute of Technology. Slide 8.1.14 Something different happens with quotes. If we type in an expression involving the special name quote, the evaluator checks the type of this expression, recognizes the special form, and uses a rule designed for such special expressions. In the case of quote, we simply take the second subexpression and create an internal representation for it. The reader recognizes this as a sequence of characters and creates a symbol with that sequence of characters, like a name. The evaluator then returns to the visible world something to print out, simply the name that we just quoted, beta in this case. Slide 8.1.15 Now that we have the ability to create this new kind of data object, note that we can use it anywhere we would expect to use such primitive objects. For example, we can certainly create a list of normal things, like numbers. Remember that creating the list of 1 and 2 returns a printed representation of that list structure, written as (1 2). Slide 8.1.16 ... but I could also create a list of quoted things. We evaluate the arguments to list, getting two symbols, then create the list of those symbols, finishing with a printed representation of the structure created by gluing those symbols together. Slide 8.1.17 What does that list look like? Well, list creates a box-andpointer structure just as in the case of numbers. Thus at the top level of that structure, we will have a skeleton containing two things, ending in the special "empty list" symbol. And what hangs off of this spine? A pointer to the data structure of a symbol! Thus we can use symbols in the same places we might have earlier used numbers within other data structures