Commit 04482f0c authored by Zach Beane's avatar Zach Beane
Browse files

Add EXCL:FASL-WRITE and EXCL:FASL-READ.

Implemented with CL-STORE.
parent 394e25b4
......@@ -427,3 +427,21 @@ values otherwise."
(setf i (logior (ash i 8) octet)))
result)
i)))))
;;; FASL
(defun excl:fasl-write (object stream &optional fasl-circle compile-verbose)
(declare (ignore compile-verbose))
(let ((*check-for-circs* fasl-circle))
;; This conversion is used because calls to EXCL:FASL-WRITE assume
;; a bivalent stream while passing a character stream. May not
;; matter, because it's not in a hot spot - just called at proxy
;; shutdown.
(let ((octets
(with-output-to-sequence (s)
(store object stream))))
(write-string (octets-to-string octets :external-format :latin-1) stream))))
(defun excl:fasl-read (file)
(with-open-file (stream file :element-type '(unsigned-byte 8))
(restore stream)))
......@@ -102,7 +102,11 @@
#:uri-fragment
#:uri-userinfo
#:uri-query
#:parse-uri))
#:parse-uri)
(:import-from #:cl-store
#:store
#:restore
#:*check-for-circs*))
(defpackage #:zacl-reader
(:use #:cl)
......@@ -143,6 +147,8 @@
#:md5-update
#:md5-final)
(:export #:gc
#:fasl-write
#:fasl-read
#:pop-atomic
#:push-atomic
#:single-channel-simple-stream
......
......@@ -14,7 +14,8 @@
#:trivial-garbage
#:trivial-backtrace
#:split-sequence
#:queues.simple-cqueue)
#:queues.simple-cqueue
#:cl-store)
:serial t
:components ((:file "package")
(:file "defpackage-hack")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment