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,20 @@
|
||||
;;; FILES 1: WITH-OPEN-FILE (solution)
|
||||
|
||||
(defparameter *note-file* "lisplings-note.txt")
|
||||
|
||||
(defun save-note ()
|
||||
(with-open-file (out *note-file* :direction :output :if-exists :supersede)
|
||||
(format out "(lisp is lovely)~%")
|
||||
t))
|
||||
|
||||
(defun load-note ()
|
||||
(with-open-file (in *note-file*)
|
||||
(read in)))
|
||||
|
||||
;;; ------------------------------------------------------------------
|
||||
;;; Checks. Read them - they tell you what to aim for - but leave
|
||||
;;; them unchanged.
|
||||
;;; ------------------------------------------------------------------
|
||||
|
||||
(check (save-note))
|
||||
(check-equal '(lisp is lovely) (load-note))
|
||||
Reference in new issue
Block a user