Plaster

common-lisp
(defun binary-to-lisp (input-file output-file name) (with-open-file (out output-file :direction :output) (let ((octets (alexandria:read-file-into-byte-vector input-file))) ;; We need to resort to format because we have no way to do ;; read-time evaluation without #. :( (format out "(defvar ~A #.(make-array ~D :element-type '(unsigned-byte 8) :initial-contents ~S))~%" name (length octets) octets))))