4-ch Thread Watcher in CL (4)

3 Name: #!/usr/bin/anonymous : 2009-08-28 14:05 ID:AXpao/1R

I implemented the save/load feature too. Add these lines to the source code:

(defparameter *list-path* "/foo/bar/4-ch.watchlist"))
(defun save-watch-list (&optional (path *list-path*)
(list *watch-list*))
(with-open-file (stream path :if-exists :supersede :direction :output)
(write list :stream stream)))
(defun load-watch-list (&optional (path *list-path*))
(with-open-file (stream path)
(dump (setq *watch-list*
(read stream)))))

Or if you can't be bothered, here's the whole source code, again:
http://paste.lisp.org/display/86187

Set *list-path* to the file you want the contents of your watch list to be saved, and use (save-watch-list) to save the watch-list, and (load-watch-list), to load it.

This thread has been closed. You cannot post in this thread any longer.