The Department of Computer Science & Engineering
cse@buffalo

CSE202: Programming in Lisp

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
  1. page 34, line 10: Change
    #<Package USER 4515050>
    to
    #<The COMMON-LISP-USER package>

  2. page 37, line 19: Change
    (type-of '123456789)
    to
    (type-of '1234567890)

  3. 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
    

  4. page 40, line 18: Change
    (type-of (type-of "frank"))
    to
    (type-of (type-of 5))

Notes
  1. Read Chapter 6

  2. 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.

  3. 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 -----------------------
    

  4. Replace the occurrences of ??? and ___ in ch6.cl with the answers of the given exercises.

  5. Do all the other exercises of Chapter 6, as well as those you will submit. Pay particular attention to the exercises marked (i).

  6. Submit ch6.cl

Next

Copyright © 1999, 2000 by Stuart C. Shapiro. All rights reserved.

Stuart C. Shapiro <shapiro@cse.buffalo.edu>