Wave 4: add sequences/vectors/files chapters, 23 exercises, quiz3, finish ceremony, PCL table
This commit is contained in:
1 parent
77843402fa
commit
4675bd1106
76 files changed
+2505
-14
No files matched your search
@@ -0,0 +1,22 @@
|
||||
;;; FILES 3: PRINTING TO STREAMS (solution)
|
||||
|
||||
(defun two-views (x)
|
||||
(with-output-to-string (s)
|
||||
(prin1 x s)
|
||||
(princ " " s)
|
||||
(princ x s)))
|
||||
|
||||
(defun name-tag (name)
|
||||
(with-output-to-string (s)
|
||||
(print "name:" s)
|
||||
(princ name s)))
|
||||
|
||||
;;; ------------------------------------------------------------------
|
||||
;;; Checks. Read them - they tell you what to aim for - but leave
|
||||
;;; them unchanged.
|
||||
;;; ------------------------------------------------------------------
|
||||
|
||||
(check-equal "\"hi\" hi" (two-views "hi"))
|
||||
(check-equal "7 7" (two-views 7))
|
||||
(check-equal "
|
||||
\"name:\" ada" (name-tag "ada"))
|
||||
Reference in new issue
Block a user