Course
Grades
Email
Welcome
Policies
Grades
Inc
Intgrty
Preface
Part I
Chap 1
Chap 2
Chap 3
XEmacs
Chap 4
Chap 5
Chap 6
Chap 7
Chap 8
Chap 9
Part II
Chap 10
Chap 11
Chap 12
Chap 13
Chap 14
Chap 15
Chap 16
Chap 17
Chap 18
Chap 19
Chap 20
Chap 21
Chap 22
Chap 23
Part III
Chap 24
Chap 25
Chap 26
Chap 27
Chap 28
Chap 29
Chap 30
Chap 31
Chap 32
|
CHAPTER 6: SYMBOLS
- Corrections
-
- page 34, line 10: Change
#<Package USER 4515050>
to
#<The COMMON-LISP-USER package>
- page 37, line 19: Change
(type-of '123456789)
to
(type-of '1234567890)
- page 38, lines 6-9: Change
> (type-of "frank")
STRING
> (type-of (type-of "frank"))
SYMBOL
to
> (type-of 5)
FIXNUM
> (type-of (type-of 5))
SYMBOL
- page 40, line 18: Change
(type-of (type-of "frank"))
to
(type-of (type-of 5))
- Notes
-
- Read Chapter 6
- Note this interaction
> (type-of "Is this is a string?")
(SIMPLE-ARRAY CHARACTER (20))
Common Lisp represents strings as arrays of characters, and so uses
this as the type instead of STRING . Arrays are introduced
very briefly in Chapter 34.
- Create a file named
ch6.cl , and initialize it
with the following
----------------------- cut here -----------------------
;;; Answers to Chapter 6 Exercises
;;; 6.14 A quoted symbol whose print name contains the character #\; is
???
;;; 6.17 The types of 10/3 and of #\t are
???
;;; and
???
;;; 6.18 The type of '(1 2 3) is
???
;;; 6.25 Fill in the blanks so that you get the value given:
> (char (symbol-name '___) ___)
#\newline
----------------------- cut here -----------------------
- Replace the occurrences of
??? and
___ in ch6.cl with the answers of the given
exercises.
- Do all the other exercises of Chapter 6, as well as those you
will submit. Pay particular attention to the exercises marked (i).
- Submit
ch6.cl
|