3
SEXP如果我寫使用如何從文件中讀取
(with-open-file (s "~/example.sexp" :direction :output)
(write '(1 2 3) :stream s)
(write '(4 5 6) :stream s)
(write '(7 8 9) :stream s))
創建一個文件一個文件,其中包含
(1 2 3)(4 5 6)(7 8 9)
但是,當我試圖打開並閱讀使用
(setf f (open "~/example.sexp"))
(read :input-stream f)
我收到「:INPUT-STREAM不是STREAM類型」錯誤。
(type-of f)
回報STREAM :: LATIN-1-FILE-STREAM這看起來是至少接近我所需要的。有什麼不同?
如何讀取已寫入文件的列表?