26 lines
577 B
Common Lisp
26 lines
577 B
Common Lisp
;;; S-EXPRESSIONS 4: READER SHORTHAND (solution)
|
|
|
|
(defstruct point x y)
|
|
|
|
(defun the-adder ()
|
|
#'+)
|
|
|
|
(defun counting ()
|
|
#(1 2 3))
|
|
|
|
(defun origin ()
|
|
#s(point :x 1 :y 2))
|
|
|
|
(defun magic-web-number ()
|
|
#xdeadbeef)
|
|
|
|
;;; ------------------------------------------------------------------
|
|
;;; Checks. Read them - they tell you what to aim for - but leave
|
|
;;; them unchanged.
|
|
;;; ------------------------------------------------------------------
|
|
|
|
(check (functionp (the-adder)))
|
|
(check (vectorp (counting)))
|
|
(check (point-p (origin)))
|
|
(check-equal 3735928559 (magic-web-number))
|