Lecture 5: In Class Activity

Solution Key


Problem 1

There are 4 symbols bound textually, and 10 created. Internally there are 2 bound symbols and 8 created symbols. 10 symbols from other packages are referred to.

In studying for the exam, do not concentrate on this question.


Problem 2a

(defpackage "GEOMETRY"
 (:use "COMMON-LISP")
 (:nicknames "GEOM")
 (:export "TRIANGLE" "MAKE-TRIANGLE" "TRIANGLE-A" "TRIANGLE-B" "TRIANGLE-C")
)

(in-package 'geometry)

(defstruct triangle a b c)


Problem 2b

(defpackage "SILLY"
  (:use "COMMON-LISP" "GEOMETRY")
  (:export "DT" "MAKE-DT")
)

(in-package 'silly)

(defstruct dt (x (make-triangle)) (y (make-triangle)))


Back to main page...