Optimized alternative to vl-read-file that reads the entire file into nrev.
(vl-read-file-rchars filename nrev &key (state 'state)) → (mv okp nrev state)
We implement this mainly for vl-read-files.
Function:
(defun vl-read-file-rchars-fn (filename nrev state) (declare (xargs :stobjs (nrev state))) (declare (xargs :guard (stringp filename))) (let ((__function__ 'vl-read-file-rchars)) (declare (ignorable __function__)) (mbe :logic (non-exec (b* (((mv okp data state) (vl-read-file filename))) (mv okp (append nrev data) state))) :exec (b* (((mv channel state) (open-input-channel filename :byte state)) ((unless channel) (mv nil nrev state)) ((mv nrev state) (vl-read-file-loop-aux channel filename 1 0 nrev)) (state (close-input-channel channel state))) (mv t nrev state)))))